> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Renegociar un contrato cerrado por terminación del vínculo laboral

> Esta operación actúa como proxy de renegociar-consignado-trabalhador (Manual 006 v1.12 §2.3): renegocia un contrato cerrado en la situación 15 ("Encerrado por término de vínculo") en uno nuevo contra el nuevo vínculo laboral del trabajador. NumeroContratoEncerrado debe ser una averbação del tenant autenticado que la red reconoció y debe diferir del nuevo número de contrato en la ruta; eso se verifica aquí, antes de llamar a la red. Si el contrato cerrado realmente se encuentra en la situación 15, si el nuevo vínculo es elegível o inelegível solo por el motivo 8, y si valorParcela permanece dentro de la propia cuota del contrato cerrado (regra bl) son hechos de registro en vivo de los cuales esta gateway no posee ninguna copia local y difiere al propio juicio de la red. Se requiere valorIOF, siguiendo el Manual en lugar de la lista requerida de Swagger reflejada. Se requiere X-Idempotency.



## OpenAPI

````yaml es/openapi/v3-current/consignado.yaml post /v1/consignado/contracts/{numero_contrato}/renegociacao
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    Superficie OpenAPI 3.1 para Lerian Consignado — Dataprev. API cubre las
    credenciales y la configuración de red de tenant, el margen de los
    trabajadores, las subastas y ofertas de préstamos, el registro y el ciclo de
    vida de los contratos, la confirmación de desembolsos, la portabilidad, la
    refinanciación, la renegociación, las garantías de FGTS, la conciliación,
    los fondos, las asignaciones, el uso, el rendimiento y las suscripciones a
    eventos. El material secreto se escribe en el almacén secreto tenant y
    ninguna operación lo devuelve nunca.
  license:
    name: Lerian Studio General License
  title: Lerian Consignado API
  version: v1.0.0
servers:
  - url: https://consignado.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - description: >-
      Custodia de credenciales de Dataprev y configuración pública del rail por
      tenant (carga, estado, rotación, revocación, código del solicitante y URL
      base del portal del trabajador)
    name: Credentials
  - description: >-
      Uso de la gateway del consignado en el ámbito del tenant: agregación de
      unidades facturables con precio por competencia
    name: Consignado Usage
  - description: >-
      Plano de control de suscripción al hub de streaming per-tenant (enumerar,
      crear, obtener, rotar, revocar y probar la entrega)
    name: Subscriptions
  - description: >-
      Superficie de rail de nómina Dataprev: lecturas de saldo y autorización
      FGTS, ejecución de garantía FGTS, suspensión de contrato, reactivación y
      cambios de términos, documentos de contrato propios de la red y lecturas
      bajo demanda de leilão solicitações, escriturações, repasses y
      terminaciones de empleo.
    name: Consignado Rail
  - description: >-
      Superficie de comando de red síncrona: las operaciones de un bancarizador
      sin que el prestamista conduzca sobre HTTP. Cada uno comparte su
      implementación de comando con el activador de evento de prestamista
      equivalente.
    name: Consignado Rail Commands
  - description: >-
      Confirmación de desembolso propiedad de la gateway: un banco cliente que
      registra el dinero que ya pagó a un trabajador. No cruza ninguna frontera
      gubernamental y no representa ninguna operación Dataprev.
    name: Consignado Disbursement
  - description: >
      Rendimiento de red Dataprev saliente de autoservicio per-tenant: lea y
      configure el requests-per-second propio de este tenant, incluida una pausa
      deliberada en cero
    name: Consignado Throughput
paths:
  /v1/consignado/contracts/{numero_contrato}/renegociacao:
    post:
      tags:
        - Consignado Rail
      summary: Renegociar un contrato cerrado por terminación del vínculo laboral
      description: >-
        Esta operación actúa como proxy de renegociar-consignado-trabalhador
        (Manual 006 v1.12 §2.3): renegocia un contrato cerrado en la situación
        15 ("Encerrado por término de vínculo") en uno nuevo contra el nuevo
        vínculo laboral del trabajador. NumeroContratoEncerrado debe ser una
        averbação del tenant autenticado que la red reconoció y debe diferir del
        nuevo número de contrato en la ruta; eso se verifica aquí, antes de
        llamar a la red. Si el contrato cerrado realmente se encuentra en la
        situación 15, si el nuevo vínculo es elegível o inelegível solo por el
        motivo 8, y si valorParcela permanece dentro de la propia cuota del
        contrato cerrado (regra bl) son hechos de registro en vivo de los cuales
        esta gateway no posee ninguna copia local y difiere al propio juicio de
        la red. Se requiere valorIOF, siguiendo el Manual en lugar de la lista
        requerida de Swagger reflejada. Se requiere X-Idempotency.
      operationId: renegociarConsignadoContract
      parameters:
        - description: >-
            The NEW (renegotiated) contract number, minted by the CLIENT — the
            rail mints nothing here.
          in: path
          name: numero_contrato
          required: true
          schema:
            description: >-
              The NEW (renegotiated) contract number, minted by the CLIENT — the
              rail mints nothing here.
            examples:
              - Qwerty123456789
            maxLength: 15
            minLength: 1
            type: string
        - description: >-
            Client-chosen idempotency key. REQUIRED: an absent key is 422, never
            a generated default.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: >-
              Client-chosen idempotency key. REQUIRED: an absent key is 422,
              never a generated default.
            examples:
              - idem-renegociacao-0001
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenegociacaoBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RenegociacaoOperationResponse'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    RenegociacaoBody:
      additionalProperties: false
      properties:
        codigoInscricaoEmpregador:
          description: 'Employer inscription type: 1 CNPJ, 2 CPF.'
          examples:
            - '2'
          pattern: ^[12]$
          type: string
        competenciaInicioDesconto:
          description: >-
            Payroll competência of the first deduction, yyyyMM. Optional; the
            rail assumes the current competência when omitted.
          examples:
            - '202501'
          pattern: ^[0-9]{6}$
          type: string
        cpfTrabalhador:
          description: Worker CPF, 11 digits.
          examples:
            - '27928255022'
          maxLength: 11
          minLength: 11
          pattern: ^[0-9]{11}$
          type: string
        dataFimContrato:
          description: End date of the new consignado contract, RFC 3339 UTC.
          examples:
            - '2026-01-24T00:00:00Z'
          format: date-time
          type: string
        dataInicioContrato:
          description: Start date of the new consignado contract, RFC 3339 UTC.
          examples:
            - '2025-01-24T00:00:00Z'
          format: date-time
          type: string
        dataPrimeiroDesconto:
          description: Date of the first payroll deduction, RFC 3339 UTC.
          examples:
            - '2025-01-28T00:00:00Z'
          format: date-time
          type: string
        matricula:
          description: Matrícula assigned to the worker by the employer.
          examples:
            - teste4243
          maxLength: 20
          type: string
        nomeTrabalhador:
          description: Worker's full name.
          examples:
            - testeead
          maxLength: 100
          type: string
        numeroContratoEncerrado:
          description: >-
            The PRIOR contract this renegociação replaces. Must be an averbação
            of the authenticated tenant that the rail acknowledged, and must
            differ from the new contract number in the path.
          examples:
            - Qwerty123456780
          maxLength: 15
          minLength: 1
          type: string
        numeroInscricaoEmpregador:
          description: Employer inscription number, Texto.
          examples:
            - '42422253000101'
          maxLength: 14
          type: string
        numeroParcelas:
          description: >-
            Number of instalments of the new contract, capped at the manual's
            own published range 1 to 99 (Manual 006 §2.3.2 line 748).
          examples:
            - 8
          format: int64
          maximum: 99
          minimum: 1
          type: integer
        valorCETAnual:
          description: valorCETAnual — Custo Efetivo Total, annual percent decimal string.
          examples:
            - '0.20'
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorCETMensal:
          description: >-
            valorCETMensal — Custo Efetivo Total, monthly percent decimal
            string.
          examples:
            - '0.10'
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorEmprestimo:
          description: >-
            valorEmprestimo — the new contract's principal (decimal string,
            BRL).
          examples:
            - '3000.00'
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorIOF:
          description: >-
            valorIOF — the IOF charged, in reais (decimal string, BRL).
            Obrigatório on the manual even though the mirrored Swagger's
            required list omits it.
          examples:
            - '0.10'
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorLiberado:
          description: >-
            valorLiberado — amount delivered to the worker (decimal string,
            BRL).
          examples:
            - '2000.00'
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorParcela:
          description: >-
            valorParcela — the new contract's instalment amount (decimal string,
            BRL). Must not exceed the closed contract's own instalment (regra
            BL) — a comparison this gateway cannot make locally and leaves to
            the rail.
          examples:
            - '400.00'
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaAnual:
          description: valorTaxaAnual — annual interest rate, percent decimal string.
          examples:
            - '0.30'
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
        valorTaxaMensal:
          description: valorTaxaMensal — monthly interest rate, percent decimal string.
          examples:
            - '0.10'
          maxLength: 13
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          type: string
      required:
        - numeroContratoEncerrado
        - cpfTrabalhador
        - matricula
        - nomeTrabalhador
        - codigoInscricaoEmpregador
        - numeroInscricaoEmpregador
        - dataInicioContrato
        - dataFimContrato
        - dataPrimeiroDesconto
        - numeroParcelas
        - valorLiberado
        - valorEmprestimo
        - valorParcela
        - valorIOF
        - valorTaxaAnual
        - valorTaxaMensal
        - valorCETAnual
        - valorCETMensal
      type: object
    RenegociacaoOperationResponse:
      additionalProperties: false
      properties:
        competenciaInicioDesconto:
          description: Payroll competência of the first deduction, yyyyMM.
          examples:
            - '202501'
          type: string
        hashOperacao:
          description: The rail's own identity for this operation.
          examples:
            - '9598435'
          type: string
        mensagem:
          description: The rail's own message.
          examples:
            - Inclusão efetuada com sucesso
          type: string
        numeroContrato:
          description: The new contract's number, as confirmed by the rail.
          examples:
            - Qwerty123456789
          type: string
      required:
        - mensagem
        - numeroContrato
        - competenciaInicioDesconto
        - hashOperacao
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````