> ## Documentation Index
> Fetch the complete documentation index at: https://bmpdocs.moneyp.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# 8 - Gerar Múltiplos Boletos

Permite gerar boletos para as parcelas informadas definindo data de vencimento e valor de desconto, podendo ou não notificar o cliente.

## Mensagens de erro

A tabela abaixo representa as mensagens de erro que podem ser retornadas ao tentar realizar uma requisição.

<Expandable title="Mensagens de requisições com erro">
  O retorno de uma requisição com status HTTP 400 (Bad Request) pode incluir as seguintes mensagens de erro:

  <Note>No exemplo de retorno ao lado, o campo `code` representa a coluna **Código** desta tabela; o campo `context` representa a coluna **Contexto**; e o campo `description` representa a coluna **Erro**.</Note>

  | Contexto | Código | Erro                                                                                                                          |
  | -------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
  | -        | V0001  | Parcela XXXX - Valor de desconto maior ou igual ao valor da parcela                                                           |
  | C0321    | V0002  | Não foi possível salvar os boletos                                                                                            |
  | C0166    | V0002  | Deve ser enviado pelo um boleto                                                                                               |
  | C0166    | V0003  | Data de vencimento deve ser maior a data atual                                                                                |
  | C0166    | V0004  | Valor do boleto deve ser informado                                                                                            |
  | C0166    | V0005  | Cliente não localizado                                                                                                        |
  | C0166    | V0006  | Não foi possível salvar os Boletos                                                                                            |
  | C0157    | V0001  | Nenhuma parcela informada                                                                                                     |
  | C0157    | V0002  | Nenhuma parcela encontrada                                                                                                    |
  | C0157    | V0004  | Parcelas XXXX não localizadas                                                                                                 |
  | C0157    | V0005  | Parcelas XXXX já pagas, não é possível gerar liquidação                                                                       |
  | C0157    | V0006  | Já existe uma cobrança em aberto para a agenda e parcelas em questão: XXXX                                                    |
  | C0157    | V0007  | Parcelas XXXX ser informadas com data de vencimento futuras                                                                   |
  | C0157    | V0008  | Descapitalização desabilitada para esta agenda                                                                                |
  | C0302    | V0002  | Layout não encontrado                                                                                                         |
  | C0302    | V0003  | Layout do fundo não foi encontrado                                                                                            |
  | C0302    | V0001  | Não foi configurado um modelo para o fundo                                                                                    |
  | C0302    | V0004  | A parametrização do fundo indica 'ObservarTipoContrato', mas não foi configurado um modelo para o tipo de contrato em questão |
  | C0267    | V0001  | Sequência inválida                                                                                                            |
  | C0010    | V0001  | Parceiro não tem permissão para gerar boletos na Agenda de Recebíveis                                                         |
  | C0010    | V0002  | Parceiro não tem permissão para aplicar desconto em parcelas na Agenda de Recebíveis                                          |
</Expandable>


## OpenAPI

````yaml post /AgendaRecebivel/GerarMultiplosBoletos
openapi: 3.0.1
info:
  title: BMPDigitalCore.ApiExterna.AgendaRecebivel.API
  version: '1.0'
servers:
  - url: https://api.bmpdigital.moneyp.dev.br/
    description: Localhost
security:
  - Bearer: []
paths:
  /AgendaRecebivel/GerarMultiplosBoletos:
    post:
      tags:
        - AgendaRecebivel
      parameters:
        - name: IdempotencyKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgendaRecebivelGeraMultiplosBoletosCommand'
          text/json:
            schema:
              $ref: '#/components/schemas/AgendaRecebivelGeraMultiplosBoletosCommand'
          application/*+json:
            schema:
              $ref: '#/components/schemas/AgendaRecebivelGeraMultiplosBoletosCommand'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ActionResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResponseBase'
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBase'
            text/json:
              schema:
                $ref: '#/components/schemas/ResponseBase'
components:
  schemas:
    AgendaRecebivelGeraMultiplosBoletosCommand:
      type: object
      properties:
        dto:
          $ref: '#/components/schemas/FindAgendaRecebivelDTO'
        dtoGerarMultiplosBoletos:
          $ref: '#/components/schemas/AgendaRecebivelGerarMultiplosBoletosDTO'
      additionalProperties: false
    ActionResponse:
      type: object
      properties:
        msg:
          type: string
          nullable: true
        result:
          type: boolean
          writeOnly: true
        hasError:
          type: boolean
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
          nullable: true
        parametros:
          type: array
          items:
            $ref: '#/components/schemas/ParametroDTO'
          nullable: true
      additionalProperties: false
    ResponseBase:
      type: object
      properties:
        msg:
          type: string
          nullable: true
        result:
          type: boolean
          writeOnly: true
        hasError:
          type: boolean
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
          nullable: true
      additionalProperties: false
    FindAgendaRecebivelDTO:
      type: object
      properties:
        codigoProposta:
          type: string
          description: Código identificador da proposta na BMP.
          format: uuid
          nullable: true
        codigoOperacao:
          maxLength: 50
          minLength: 0
          type: string
          description: Código identificador da proposta (valor exclusivo do integrador).
          nullable: true
      additionalProperties: false
    AgendaRecebivelGerarMultiplosBoletosDTO:
      required:
        - descricaoBoleto
      type: object
      properties:
        descricaoBoleto:
          maxLength: 200
          minLength: 1
          type: string
          description: Define uma descrição para o boleto gerado.
          nullable: true
        notificarCliente:
          type: boolean
          description: Indica se o cliente deve ser notificado sobre os boletos gerados.
        tipoRegistro:
          type: integer
          description: 'Define a modalidade de registro automático: 1 - Online; 2 - Offline.'
          format: int32
          nullable: true
        parcelas:
          type: array
          items:
            $ref: '#/components/schemas/AgendaRecebivelGerarMultiplosBoletosParcela'
          nullable: true
      additionalProperties: false
    Message:
      type: object
      properties:
        messageType:
          $ref: '#/components/schemas/ErrorType'
        code:
          type: string
          nullable: true
        context:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        field:
          type: string
          nullable: true
      additionalProperties: false
    ParametroDTO:
      required:
        - nome
        - valor
      type: object
      properties:
        nome:
          type: string
          nullable: true
        valor:
          type: string
          nullable: true
      additionalProperties: false
    AgendaRecebivelGerarMultiplosBoletosParcela:
      required:
        - dtVencimento
        - nroParcela
      type: object
      properties:
        nroParcela:
          type: integer
          description: Número da parcela.
          format: int32
        dtVencimento:
          type: string
          description: Data de vencimento do boleto.
          format: date-time
          nullable: true
        dtExpiracao:
          type: string
          description: Define a data limite de pagamento do boleto.
          format: date-time
          nullable: true
        vlrDesconto:
          type: number
          description: Define um valor de desconto para o boleto.
          format: double
          nullable: true
        permiteDescapitalizacao:
          type: boolean
          description: >-
            Define se o valor da parcela deve ser descapitalizado para a data do
            pagamento.
          nullable: true
      additionalProperties: false
    ErrorType:
      enum:
        - 1
        - 2
        - 3
      type: integer
      format: int32
  securitySchemes:
    Bearer:
      type: apiKey
      description: Informe o token
      name: Authorization
      in: header

````