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

# Inclusão de benefício em membro existente

> Inclui um novo benefício para um membro já existente.



## OpenAPI

````yaml openapi.yaml POST /v1/enrollment/inclusion/{member-tax-id}
openapi: 3.1.0
info:
  title: Pipo Public API
  version: 0.2.0
  description: >
    API pública da Pipo Saúde para integração de movimentações de benefícios

    (inclusões, exclusões e consultas) por parceiros e sistemas de folha de
    pagamento.
  contact:
    name: Pipo Engineering
    email: felipe.rodopoulos@piposaude.com.br
servers:
  - url: https://api.pipo.health
    description: Homologação (staging)
  - url: https://api.piposaude.com.br
    description: Produção
security:
  - bearerAuth: []
tags:
  - name: Autenticação
    description: Obtenção do token de acesso.
  - name: Empresas
    description: Consulta de empresas e seus produtos.
  - name: Benefícios
    description: Consulta de produtos/benefícios disponíveis.
  - name: Movimentações
    description: Inclusões, exclusões e histórico de movimentações.
  - name: Membros
    description: Consulta de membros e seus benefícios.
  - name: Solicitações
    description: Consulta do status de requisições assíncronas.
  - name: Health Check
    description: Verificação de disponibilidade.
paths:
  /v1/enrollment/inclusion/{member-tax-id}:
    post:
      tags:
        - Movimentações
      summary: Inclusão de benefício em membro existente
      description: Inclui um novo benefício para um membro já existente.
      parameters:
        - $ref: '#/components/parameters/MemberTaxIdPath'
        - $ref: '#/components/parameters/AutoResolveEnrollments'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BenefitInclusionRequest'
            example:
              company-tax-id: '12345678000190'
              member-benefits:
                beneficiary-type: primary
                products:
                  health-insurance:
                    - name: Plano Saúde Premium
                      start-option: on-inclusion-date
      responses:
        '200':
          $ref: '#/components/responses/RequestAccepted'
        '400':
          description: Membro não é titular na empresa especificada.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Member is not primary with the specified company
        '403':
          $ref: '#/components/responses/GenericForbidden'
        '422':
          description: >-
            Dados inválidos, movimentação não aceita — payload com offenses
            (violações de validação).
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    $ref: '#/components/schemas/FlatMemberBenefitsWithOffenses'
              example:
                result:
                  beneficiary-type: primary
                  company-tax-id: '12345678000190'
                  products:
                    health-insurance:
                      - name: Plano Saúde Premium
                        start-option: on-inclusion-date
                  offenses:
                    - product-health-insurance-0-already-exists
components:
  parameters:
    MemberTaxIdPath:
      name: member-tax-id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Cpf'
      description: CPF do membro.
    AutoResolveEnrollments:
      name: auto-resolve-enrollments
      in: query
      required: false
      schema:
        type: string
        enum:
          - approve
          - reject
      description: >
        Resolve automaticamente a movimentação: `approve` aprova; `reject`
        rejeita.

        **Esta opção existe apenas no ambiente de Homologação, para testes.**
  schemas:
    BenefitInclusionRequest:
      type: object
      required:
        - company-tax-id
        - member-benefits
      properties:
        company-tax-id:
          $ref: '#/components/schemas/Cnpj'
        member-benefits:
          $ref: '#/components/schemas/FlatMemberBenefits'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Mensagem descritiva do erro.
    FlatMemberBenefitsWithOffenses:
      allOf:
        - $ref: '#/components/schemas/FlatMemberBenefits'
        - type: object
          required:
            - company-tax-id
          properties:
            company-tax-id:
              $ref: '#/components/schemas/Cnpj'
            offenses:
              type: array
              items:
                type: string
    Cpf:
      type: string
      description: CPF (Cadastro de Pessoas Físicas). Aceita apenas dígitos ou formatado.
      examples:
        - '12345678900'
        - 123.456.789-00
    Cnpj:
      type: string
      description: >-
        CNPJ (Cadastro Nacional da Pessoa Jurídica). Aceita apenas dígitos ou
        formatado.
      examples:
        - '12345678000190'
        - 12.345.678/0001-90
    FlatMemberBenefits:
      type: object
      required:
        - beneficiary-type
        - products
      properties:
        beneficiary-type:
          $ref: '#/components/schemas/MemberType'
        products:
          $ref: '#/components/schemas/ProductsMap'
        dependents:
          type: array
          description: Lista de dependentes para incluir no benefício.
          items:
            $ref: '#/components/schemas/Dependent'
        primary-tax-id:
          $ref: '#/components/schemas/Cpf'
          description: >-
            CPF do membro titular, usado para vincular o dependente ao seu
            titular. Obrigatório apenas quando `beneficiary-type` é `dependent`.
        dependent-relationship-type:
          $ref: '#/components/schemas/RelationshipType'
          description: >-
            Tipo de relacionamento entre o dependente e o titular. Obrigatório
            apenas quando `beneficiary-type` é `dependent`.
        dependent-relationship-start-date:
          type: string
          format: date
          description: >-
            Data em que o relacionamento entre o dependente e o titular começou.
            Obrigatório apenas quando `beneficiary-type` é `dependent`.
        documents:
          type: array
          items:
            $ref: '#/components/schemas/Document'
      if:
        properties:
          beneficiary-type:
            const: dependent
        required:
          - beneficiary-type
      then:
        required:
          - primary-tax-id
          - dependent-relationship-type
          - dependent-relationship-start-date
    MemberType:
      type: string
      description: Tipo de membro. primary=Titular, dependent=Dependente.
      enum:
        - primary
        - dependent
    ProductsMap:
      type: object
      description: Mapa de tipo de produto → lista de entradas de produto.
      additionalProperties:
        type: array
        items:
          $ref: '#/components/schemas/ProductEntry'
      example:
        health-insurance:
          - name: Plano Saúde Premium
            start-option: on-inclusion-date
    Dependent:
      description: >-
        Dependente a incluir em um benefício. Herda os campos da estrutura base
        do beneficiário e complementa com o vínculo com o titular, sempre
        obrigatório.
      allOf:
        - $ref: '#/components/schemas/BeneficiaryBase'
        - type: object
          required:
            - primary-tax-id
            - dependent-relationship-type
            - dependent-relationship-start-date
          properties:
            primary-tax-id:
              $ref: '#/components/schemas/Cpf'
              description: >-
                CPF do membro titular, usado para vincular o dependente ao seu
                titular.
            dependent-relationship-type:
              $ref: '#/components/schemas/RelationshipType'
              description: Tipo de relacionamento entre o dependente e o titular.
            dependent-relationship-start-date:
              type: string
              format: date
              description: >-
                Data em que o relacionamento entre o dependente e o titular
                começou.
    RelationshipType:
      type: string
      description: Tipo de relação do dependente com o titular.
      enum:
        - adopted-child
        - child
        - companion
        - grandchild
        - grandparent
        - great-grandchild
        - niece-or-nephew
        - parent-in-law
        - parent
        - sibling
        - spouse
        - stepchild
        - uncle-or-aunt
        - unknown
        - ward
    Document:
      type: object
      required:
        - document-id
        - document-type
      description: Documento relacionado ao membro, previamente enviado via URL de upload.
      properties:
        document-id:
          type: string
          description: Identificador do documento, recebido ao solicitar a URL de upload.
        document-type:
          $ref: '#/components/schemas/DocumentType'
    ProductEntry:
      type: object
      required:
        - start-option
      description: Entrada de produto na inclusão. Informe `name` ou `product-id`.
      properties:
        start-option:
          $ref: '#/components/schemas/StartOption'
        name:
          type: string
          description: Nome do produto.
        product-id:
          type: string
          format: uuid
        portability:
          type: string
          enum:
            - 'yes'
            - 'no'
          description: Portabilidade de carência (apenas produtos seguráveis).
    BeneficiaryBase:
      description: >-
        Estrutura base do beneficiário. Os dados de um membro e de um dependente
        compartilham esta estrutura.
      type: object
      required:
        - beneficiary-type
        - name
        - tax-id
        - mothers-name
        - date-of-birth
        - gender
        - marital-status
      properties:
        beneficiary-type:
          $ref: '#/components/schemas/MemberType'
        name:
          type: string
        preferred-name:
          type: string
          description: Nome social do membro.
        tax-id:
          $ref: '#/components/schemas/Cpf'
        mothers-name:
          type: string
        date-of-birth:
          type: string
          format: date
        gender:
          $ref: '#/components/schemas/Gender'
        marital-status:
          $ref: '#/components/schemas/MaritalStatus'
        email-private:
          type: string
          format: email
        phone:
          type: string
        weight:
          type: integer
          description: >-
            Peso em quilogramas × 100 (70,45 kg = 7045). Ver Convenções ›
            Números decimais.
        height:
          type: integer
          description: >-
            Altura em centímetros × 100 (1,75 m = 17500). Ver Convenções ›
            Números decimais.
        handicapped:
          type: string
          enum:
            - 'yes'
            - 'no'
          description: Indica se o membro é PCD.
        document-type:
          $ref: '#/components/schemas/NationalIdType'
        document-number:
          type: string
        document-issuer:
          type: string
        document-issuer-state:
          type: string
        document-issue-date:
          type: string
          format: date
        documents:
          type: array
          items:
            $ref: '#/components/schemas/Document'
    DocumentType:
      type: string
      description: Tipo do documento anexado à movimentação.
      enum:
        - beneficiary-inclusion-form
        - birth-certificate-or-national-id
        - company-letter
        - company-linking-declaration
        - company-social-contract
        - document-proving-relationship
        - employee-social-contract
        - employee-tax-id-card
        - employment-contract
        - enrollment-request
        - exclusion-file
        - guardianship-certificate
        - identification-document-with-tax-id
        - invoice
        - marriage-certificate
        - proof-of-dependent-relationship
        - proof-of-employment
        - proof-of-promotion
        - proof-of-residency
        - rescission
        - same-sex-marriage-certificate
        - other
    StartOption:
      type: string
      description: >
        Opção de início do benefício.

        `on-inclusion-date`, `on-admission-date`, `on-next-billing-period`,
        `on-current-billing-period`(esta última quando `on-next-billing-period`
        está habilitada; ver Convenções).
      enum:
        - on-inclusion-date
        - on-admission-date
        - on-next-billing-period
        - on-current-billing-period
    Gender:
      type: string
      description: Sexo biológico do membro.
      enum:
        - male
        - female
    MaritalStatus:
      type: string
      description: >-
        Estado civil. single=Solteiro, married=Casado, divorced=Divorciado,
        widowed=Viúvo, others=Outros.
      enum:
        - single
        - married
        - divorced
        - widowed
        - others
    NationalIdType:
      type: string
      description: Tipo de documento de identidade nacional.
      enum:
        - RG
        - RNM
        - CNH
        - passport
  responses:
    RequestAccepted:
      description: Movimentação processada com sucesso.
      content:
        application/json:
          schema:
            type: object
            required:
              - request-id
            properties:
              request-id:
                type: string
                format: uuid
                description: >-
                  Identificador da requisição. Use em `GET
                  /v1/request/{request-id}`.
          example:
            request-id: aaa11111-e89b-12d3-a456-426614174006
    GenericForbidden:
      description: Não autorizado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Not entitled to modify this member
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Token Bearer obtido em `POST /v1/authenticate`.

````