> ## Documentation Index
> Fetch the complete documentation index at: https://bmpmoneyplus-sandbox.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 16 - Calculate Grid Installments

Through this endpoint, the partner simulates the values of the proposal before even finalizing it in the system.
This method allows the override of some values originally captured from the initial store network configuration.

<Expandable title="Messaging - Calculate Grid Installments">
  | Category | Operation           | Action               | Code  | Detailed Code | Message                                                                                  |
  | -------- | ------------------- | -------------------- | ----- | ------------- | ---------------------------------------------------------------------------------------- |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0013 | V0001         | Produto não configurado para esta integração                                             |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0195 | V0001         | O número de dias de acréscimo não pode ser negativo                                      |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0196 | V0001         | O valor solicitado não é válido                                                          |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0196 | V0002         | Formato de cálculo inválido                                                              |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0196 | V0003         | É necessário o produto                                                                   |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0196 | V0004         | Prazo inválido ou não localizado para este Produto x Rede                                |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0196 | V0005         | Não é possível aprovar a proposta. Produto x Rede x Parcela não possui juros configurado |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0196 | V0006         | Configuração deve ser enviada para proposta HotMoney                                     |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0196 | V0007         | Produto Rotativo e HotMoney aceitam apenas formato de cálculo com juros                  |
  | Proposta | CalculaGridParcelas | CalcularGridParcelas | C0196 | V0008         | Formato de Cálculo não informado                                                         |
</Expandable>


## OpenAPI

````yaml post /Proposta/CalcularGridParcelas
openapi: 3.0.1
info:
  title: BMPDigitalCore.ApiExterna.Proposta.API
  version: '1.0'
servers:
  - url: https://api.bmpdigital.moneyp.dev.br/
    description: Localhost
security:
  - Bearer: []
paths:
  /Proposta/CalcularGridParcelas:
    post:
      tags:
        - Proposta
      parameters:
        - name: IdempotencyKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CalculaGridParcelasCommand'
          text/json:
            schema:
              $ref: '#/components/schemas/CalculaGridParcelasCommand'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CalculaGridParcelasCommand'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/CalculaGridParcelasResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/CalculaGridParcelasResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/CalculaGridParcelasResponse'
        '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:
    CalculaGridParcelasCommand:
      type: object
      properties:
        valorSolicitado:
          type: number
          description: Valor solicitado para financiamento
          format: double
        valorTabela:
          type: number
          description: >-
            Valor de tabela do produto. Quando o valor é diferente do solicitado
            a BMP determina o percentual de desconto que está sendo aplicado na
            operação
          format: double
        comJuros:
          type: boolean
          description: >-
            Indica se as parcelas devem ser calculadas aplicando porcentagem de
            juros ou de desconto. Caso verdadeiro, atribui às parcelas os
            valores calculados com base na % de juros, caso contrário, atribui
            os valores calculados com base na % de desconto
        nroDiasAcrescimo:
          type: integer
          description: >-
            Dias de acréscimo para o primeiro pagamento além dos primeiros 30
            dias. O valor padrão é zero
          format: int32
        tipoPessoa:
          maximum: 2
          minimum: 1
          type: integer
          description: >-
            Indica o tipo de pessoa se Física ou Jurídica para cálculo do
            Imposto sobre Operações Financeiras (IOF). 1-PF (Pessoa Física) e
            2-PJ (Pessoa Júridica)
          format: int32
      additionalProperties: false
    CalculaGridParcelasResponse:
      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
        parcelas:
          type: array
          items:
            $ref: '#/components/schemas/ParcelaDTO'
          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
    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
    ParcelaDTO:
      type: object
      properties:
        prazo:
          type: integer
          format: int32
        vlrParcela:
          type: number
          format: double
        vlrCliente:
          type: number
          format: double
        vlrLoja:
          type: number
          format: double
        percDesconto:
          type: number
          format: double
        dataPrimeiroPagamento:
          type: string
          format: date-time
          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

````