> ## 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.

# 19 - Salvar Sócios

Por meio deste endpoint o parceiro inclui ou atualiza registros de sócios de um cliente específico.
Para que ocorra uma atualização, é necessário o envio do campo código, preenchido com o código do registro na base da BMP, ou então a busca será através do campo DocumentoFederal.

<Expandable title="Tabela EstadoCivil">
  | ID | Descrição        |
  | -- | ---------------- |
  | 1  | Solteiro         |
  | 2  | Casado           |
  | 3  | Desquitado       |
  | 4  | Divorciado       |
  | 5  | Separado         |
  | 6  | Viúvo            |
  | 7  | Outros           |
  | 8  | Não informado    |
  | 9  | Vínculo Conjugal |
</Expandable>

## 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 **Código Detalhado**; e o campo `message` representa a coluna **Mensagem**.</Note>

  | Categoria | Operação                 | Ação         | Código | Código Detalhado | Mensagem                                                    |
  | --------- | ------------------------ | ------------ | ------ | ---------------- | ----------------------------------------------------------- |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | C0048  | V0001            | Método disponível para Pessoa Jurídica                      |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | C0108  | V0001            | Documento Federal deve ser informado                        |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | C0108  | V0002            | Cliente não encontrado com o documento `{documentoCliente}` |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | C0108  | V0003            | Cliente não cadastrado pelo parceiro de integração          |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | T0624  | D0001            | CPF já cadastrado como sócio                                |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | T0624  | D0002            | Documento deve ser preenchido                               |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | T0624  | D0003            | Nome deve ser preenchido                                    |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | T0624  | D0004            | CPF inválido                                                |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | T0624  | D0005            | CNPJ Inválido                                               |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | T0624  | D0006            | CEP inválido                                                |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | T0624  | D0007            | Nome do cônjuge deve ser preenchido                         |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | T0624  | D0008            | CPF do cônjuge deve ser preenchido                          |
  | Pessoa    | CreateUpdatePessoaSocios | SalvarSocios | T0624  | D0009            | CPF do cônjuge Inválido                                     |
</Expandable>


## OpenAPI

````yaml post /Pessoa/SalvarSocios
openapi: 3.0.1
info:
  title: BMPDigitalCore.ApiExterna.Pessoa.API
  version: '1.0'
servers:
  - url: https://api.bmpdigital.moneyp.dev.br/
    description: Localhost
security:
  - Bearer: []
paths:
  /Pessoa/SalvarSocios:
    post:
      tags:
        - Pessoa
      parameters:
        - name: IdempotencyKey
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUpdatePessoaSociosCommand'
          text/json:
            schema:
              $ref: '#/components/schemas/CreateUpdatePessoaSociosCommand'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CreateUpdatePessoaSociosCommand'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/CreateUpdatePessoaSociosResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/CreateUpdatePessoaSociosResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/CreateUpdatePessoaSociosResponse'
        '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:
    CreateUpdatePessoaSociosCommand:
      type: object
      properties:
        dtos:
          type: array
          items:
            $ref: '#/components/schemas/PessoaSocioDTO'
          nullable: true
        param:
          $ref: '#/components/schemas/CreateUpdatePessoaParam'
      additionalProperties: false
    CreateUpdatePessoaSociosResponse:
      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
        results:
          type: array
          items:
            $ref: '#/components/schemas/CreateUpdatePessoaSocioResponse'
          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
    PessoaSocioDTO:
      required:
        - documentoFederal
      type: object
      properties:
        codigo:
          type: string
          description: Será preenchido apenas pelo método SelectPessoa.
          nullable: true
        nome:
          maxLength: 60
          minLength: 1
          type: string
          description: Nome do Sócio
          nullable: true
        documentoFederal:
          type: string
          description: >-
            Número do Cadastro de Pessoa Física (CPF) ou do Cadastro Nacional de
            Pessoa Jurídica (CNPJ) do Sócio
          nullable: true
        rg:
          maxLength: 20
          minLength: 1
          type: string
          description: Registro Geral (RG)
          nullable: true
        rgOrgao:
          maxLength: 10
          minLength: 1
          type: string
          description: Órgão de emissão do Registro Geral (RG)
          nullable: true
        rguf:
          maxLength: 2
          minLength: 1
          type: string
          description: UF de emissão do Registro Geral (RG)
          nullable: true
        rgData:
          type: string
          description: Data de emissão do Registro Geral (RG)
          format: date-time
          nullable: true
        dtNascimento:
          type: string
          description: Data de Nascimento se sócio é Pessoa Física
          format: date-time
          nullable: true
        percCota:
          maximum: 9999.9
          minimum: 0
          type: number
          description: Percentual na sociedade
          format: double
          nullable: true
        estadoCivil:
          maximum: 9999
          minimum: 0
          type: integer
          description: Consulta tabela de estado civil
          format: int32
          nullable: true
        tipoUniao:
          maximum: 9999
          minimum: 0
          type: integer
          description: >-
            Tipo de união: 1 – Comunhão parcial de bens, 2 – Comunhão universal
            de bens, 3 – Separação total de bens
          format: int32
          nullable: true
        nomeConjuge:
          maxLength: 60
          minLength: 1
          type: string
          description: Nome do cônjuge
          nullable: true
        cpfConjuge:
          maxLength: 20
          minLength: 1
          type: string
          description: Número do Cadastro de Pessoa Física (CPF) do cônjuge
          nullable: true
        rgConjuge:
          maxLength: 20
          minLength: 1
          type: string
          description: Registro Geral (RG) do cônjuge
          nullable: true
        dtNascimentoConjuge:
          type: string
          description: Data de nascimento do cônjuge
          format: date-time
          nullable: true
        mostrarSocioCCB:
          type: boolean
          description: Indica se o Sócio aparece na Cédula de Crédito Bancário (CCB)
          nullable: true
        mostrarConjugeCCB:
          type: boolean
          description: Indica se o Cônjuge aparece na Cédula de Crédito Bancário (CCB)
          nullable: true
        fielDepositario:
          type: boolean
          description: Indica se o Sócio é Fiel Depositário
          nullable: true
        terceiroGarantidor:
          type: boolean
          description: Indica se o Sócio é Terceiro Garantidor
          nullable: true
        cep:
          maxLength: 8
          minLength: 1
          type: string
          description: Código de endereçamento Postal (CEP) do Sócio
          nullable: true
        logradouro:
          maxLength: 100
          minLength: 1
          type: string
          description: Logradouro do Sócio
          nullable: true
        nroLogradouro:
          maxLength: 15
          minLength: 1
          type: string
          description: Número do logradouro do Sócio
          nullable: true
        bairro:
          maxLength: 50
          minLength: 1
          type: string
          description: Bairro do Sócio
          nullable: true
        complemento:
          maxLength: 50
          minLength: 1
          type: string
          description: Complemento do endereço do Sócio
          nullable: true
        cidade:
          maxLength: 40
          minLength: 1
          type: string
          description: Cidade do Sócio
          nullable: true
        uf:
          maxLength: 2
          minLength: 1
          type: string
          description: Unidade Federal (UF) do Sócio
          nullable: true
        dtFundacao:
          type: string
          description: Data de fundação quando Sócio é Pessoa Jurídica (PJ)
          format: date-time
          nullable: true
        dtEntradaSocio:
          type: string
          description: Data de Entrada do sócio na sociedade
          format: date-time
          nullable: true
        nacionalidade:
          maxLength: 40
          minLength: 1
          type: string
          description: Nacionalidade do sócio
          nullable: true
        naturalDeCidade:
          maxLength: 40
          minLength: 1
          type: string
          description: Cidade de nascimento do sócio
          nullable: true
        naturalDeUF:
          maxLength: 2
          minLength: 1
          type: string
          description: Unidade Federal (UF) do sócio
          nullable: true
        telefone:
          maxLength: 20
          minLength: 1
          type: string
          description: Telefone do sócio
          nullable: true
        celular:
          maxLength: 20
          minLength: 1
          type: string
          description: Celular do sócio
          nullable: true
        email:
          maxLength: 60
          minLength: 1
          type: string
          description: E-mail do sócio
          nullable: true
        telefoneConjuge:
          maxLength: 20
          minLength: 1
          type: string
          description: Telefone do cônjuge
          nullable: true
        celularConjuge:
          maxLength: 20
          minLength: 1
          type: string
          description: Celular do cônjuge
          nullable: true
        emailConjuge:
          maxLength: 60
          minLength: 1
          type: string
          description: E-mail do cônjuge
          nullable: true
      additionalProperties: false
    CreateUpdatePessoaParam:
      required:
        - documentoCliente
      type: object
      properties:
        documentoCliente:
          maxLength: 20
          minLength: 0
          type: string
          description: Documento federal do cliente
          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
    CreateUpdatePessoaSocioResponse:
      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
        codigo:
          type: string
          format: uuid
      additionalProperties: false
    ErrorType:
      enum:
        - 1
        - 2
        - 3
      type: integer
      format: int32
  securitySchemes:
    Bearer:
      type: apiKey
      description: Informe o token
      name: Authorization
      in: header

````