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

# Condividere le informazioni KYB tramite Entities

> Invia le informazioni KYB di un subesercente con l'API Entities: la società, i suoi proprietari, il suo rappresentante legale e i relativi documenti.

Questa guida mostra, chiamata per chiamata e con richieste e risposte, come inviare le informazioni elencate in [Requisiti KYB per i beneficiari di conti virtuali](https://docs.localpayment.com/it/docs/kyb-requirements-for-sub-merchants-and-virtual-account-end-beneficiaries.md) usando l'API Entities. La destinazione di ogni elemento in Entities è indicata nella colonna “Come inviarlo” di quella pagina. In sintesi: la società è un'entità di tipo `COMPANY`, ogni persona è un'entità di tipo `INDIVIDUAL` (i proprietari vengono collegati alla società come titolari effettivi, o UBO) e ogni documento è un documento dichiarato con i relativi file. Gli esempi usano una società fittizia registrata in Brasile.

## Prerequisiti

* Questo flusso si applica ai conti virtuali in Brasile.
* Un token di accesso per l'ambiente Stage. Consulta [Ottenere il token di accesso](https://docs.localpayment.com/it/reference/get-token.md).
* Uno schema di campi personalizzati pubblicato per il tuo account esercente, con i campi KYB. Consulta [Campi personalizzati](https://docs.localpayment.com/it/docs/custom-fields.md).
* Le informazioni e i documenti della società, dei suoi proprietari e del suo rappresentante legale. Consulta [Requisiti KYB per i beneficiari di conti virtuali](https://docs.localpayment.com/it/docs/kyb-requirements-for-sub-merchants-and-virtual-account-end-beneficiaries.md).

## Flusso

```mermaid theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
%%{init: {'theme': 'base', 'themeVariables': {'background': '#ffffff', 'primaryColor': '#31467c', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#0c1a29', 'secondaryColor': '#31467c', 'tertiaryColor': '#ffffff', 'lineColor': '#0c1a29', 'textColor': '#0c1a29', 'edgeLabelBackground': '#ffffff', 'fontFamily': 'Manrope'}, 'fontFamily': 'Manrope', 'htmlLabels': false, 'flowchart': {'htmlLabels': false, 'wrappingWidth': 400, 'padding': 20}}}%%
flowchart TD
    A["1. Leggere lo schema dei campi personalizzati<br/>GET /api/entity/v1/custom-fields/schema"]:::lp --> B["2. Creare la società<br/>POST /api/entity/v1/entities, type COMPANY<br/>identificativo fiscale come documento principale, profilo aziendale in attributes"]
    B --> DH["3. Documenti della società<br/>uno per documento, ciascuno con i relativi file"]:::lp
    DH --> D1["ARTICLES_OF_INCORPORATION<br/>più l'organigramma societario, se necessario"]
    DH --> D2["PROOF_OF_FUNDS<br/>un file per documento"]
    DH --> D3["OTHER<br/>prova della titolarità, B2C"]
    D1 & D2 & D3 --> PH["4 e 5. Persone<br/>un INDIVIDUAL per ogni proprietario e per il rappresentante legale<br/>ciascuno con il proprio documento d'identità"]:::lp
    PH --> P1["Proprietario 1<br/>documento d'identità<br/>FRONT, BACK"]
    PH --> P2["Proprietario 2, 3 e così via<br/>stessi passaggi"]
    PH --> P3["Rappresentante legale<br/>stessi passaggi"]
    P1 --> L1["6. Collegare alla società, proprietario 1<br/>POST /api/entity/v1/entities/{companyId}/ubos<br/>ownershipPercentage"]
    P2 --> L2["6. Collegare alla società, ogni altro proprietario<br/>POST /api/entity/v1/entities/{companyId}/ubos<br/>ownershipPercentage"]
    P3 --> L3["6. Collegare alla società, rappresentante legale<br/>POST /api/entity/v1/entities/{companyId}/ubos<br/>ownershipPercentage 0, controlRole LEGAL_REPRESENTATIVE"]
    L1 & L2 & L3 --> V["7. Comunicare a Localpayment che il caricamento è completo<br/>POST /api/entity/v1/entities/{companyId}/verify"]
    V --> G[/"Localpayment verifica<br/>la società e ogni persona"/]:::lp
    classDef default fill:#31467c,stroke:#0c1a29,stroke-width:1px,color:#ffffff,font-family:Manrope
    classDef lp fill:#0c1a29,stroke:#0c1a29,color:#ffffff
    classDef terminal fill:#0c1a29,stroke:#0c1a29,color:#ffffff
    classDef lbl fill:#0c1a29,stroke:#0c1a29,color:#ffffff,font-size:13px
```

> [!NOTE]
>
> **Rappresentante legale.** Crealo come `INDIVIDUAL` (il suo documento d'identità può essere il documento principale) e collegalo alla società con [Collegare un UBO](https://docs.localpayment.com/it/reference/link-ubo.md): `ownershipPercentage: 0` e `controlRole: LEGAL_REPRESENTATIVE`. Se il rappresentante legale è anche un proprietario, collegalo una sola volta, con la sua percentuale e `controlRole: LEGAL_REPRESENTATIVE`.

## Passo dopo passo

Esegui le chiamate seguenti in quest'ordine. Conserva ogni `internalId` e `documentId` restituito dall'API. Gli esempi inviano solo i dati minimi.

### Leggere lo schema dei campi personalizzati

`GET /api/entity/v1/custom-fields/schema` restituisce gli attributi accettati dal tuo account. Estratto con il profilo aziendale:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "businessProfile": {
    "type": "string",
    "enum": [
      "MARKETPLACE",
      "B2C",
      "B2B"
    ]
  }
}
```

### Creare la società

`POST /api/entity/v1/entities`. L'identificativo fiscale è il documento principale e il profilo aziendale va in `attributes`:

```json Request theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "externalId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "type": "COMPANY",
  "name": "Example Company S.A.",
  "residenceCountry": "BRA",
  "document": {
    "type": "CNPJ",
    "id": "00000000000100",
    "issuingCountry": "BRA"
  },
  "website": "https://www.example.com",
  "attributes": {
    "businessProfile": "B2C"
  }
}
```

```json Response theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "internalId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "externalId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "type": "COMPANY",
  "status": "PENDING_KYC",
  "name": "Example Company S.A.",
  "residenceCountry": "BRA",
  "website": "https://www.example.com",
  "attributes": {
    "businessProfile": "B2C"
  },
  "documentationStatus": "NO_FILES"
}
```

La risposta è 201 Created (estratto). Il documento principale viene restituito con il suo `documentId` e senza file, ed è normale: non ne richiede.

### Dichiarare i documenti della società e caricarne i file

Dichiara ogni documento con `POST /api/entity/v1/entities/{companyId}/documents`. Il documento di costituzione riporta il numero di registrazione in `id` (in Brasile, il CNPJ):

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "type": "ARTICLES_OF_INCORPORATION",
  "id": "00000000000100",
  "issuingCountry": "BRA"
}
```

Poi invia un `POST /api/entity/v1/documents/{documentId}/proofs` per ogni file, con `proofType=DOCUMENT` e il file. Risposta (estratto):

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "id": "4653bc4d-7df4-41c4-b8ef-60e7a3a378bb",
  "documentId": "84f3b6db-7b74-4def-968d-cbb5bf90cab7",
  "proofType": "DOCUMENT",
  "fileName": "certificate_of_incorporation.pdf",
  "mimeType": "application/pdf",
  "verificationStatus": "PENDING",
  "status": "CURRENT"
}
```

Dichiara e carica allo stesso modo i documenti sull'origine dei fondi e, per `B2C`, la prova della titolarità:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
[
  {
    "type": "PROOF_OF_FUNDS",
    "id": "SALES-2024-Q1",
    "issuingCountry": "BRA"
  },
  {
    "type": "OTHER",
    "id": "DOMAIN-example",
    "issuingCountry": "BRA"
  }
]
```

### Creare ogni persona

Un `INDIVIDUAL` per ogni proprietario e per il rappresentante legale, con `POST /api/entity/v1/entities`. Il documento d'identità può essere il documento principale:

```json Request theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "externalId": "550e8400-e29b-41d4-a716-446655440000",
  "type": "INDIVIDUAL",
  "name": "Jane",
  "lastname": "Doe",
  "residenceCountry": "BRA",
  "document": {
    "type": "NATIONAL_ID",
    "id": "000000000",
    "issuingCountry": "BRA"
  }
}
```

```json Response theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "internalId": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526",
  "type": "INDIVIDUAL",
  "status": "PENDING_KYC",
  "document": {
    "documentId": "e6d636a0-362c-4e17-9ac9-5451d56ed393",
    "type": "NATIONAL_ID",
    "id": "000000000",
    "issuingCountry": "BRA",
    "isPrimary": true
  }
}
```

La risposta è 201 Created (estratto).

### Caricare il documento d'identità di ogni persona

Fronte e retro vanno nello stesso documento: `POST /api/entity/v1/documents/{documentId}/proofs` con `proofType=FRONT`, poi con `proofType=BACK` (passaporto: solo `FRONT`). Estratto di `GET /api/entity/v1/documents/{documentId}/proofs` dopo entrambi i caricamenti:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
[
  {
    "id": "d577e8e5-ef53-43b8-aaa3-b97ca202949a",
    "proofType": "FRONT",
    "fileName": "id_front.jpg",
    "verificationStatus": "PENDING",
    "status": "CURRENT"
  },
  {
    "id": "21e6e46d-e047-4f19-88f4-175132839e04",
    "proofType": "BACK",
    "fileName": "id_back.jpg",
    "verificationStatus": "PENDING",
    "status": "CURRENT"
  }
]
```

### Collegare ogni persona alla società

Un `POST /api/entity/v1/entities/{companyId}/ubos` per ogni persona. Jane Doe possiede il 60% ed è anche la rappresentante legale:

```json Request theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "personId": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526",
  "ownershipPercentage": 60,
  "controlRole": "LEGAL_REPRESENTATIVE"
}
```

```json Response theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "id": "37325b16-514f-40f5-afca-a2acd201f629",
  "companyId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "personId": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526",
  "ownershipPercentage": 60.0,
  "controlRole": "LEGAL_REPRESENTATIVE",
  "validFrom": "2024-01-15",
  "validTo": null,
  "createdAt": "2024-01-15T17:04:17Z"
}
```

John Doe possiede il 40%, con il ruolo in maiuscolo:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "personId": "c0b9c624-7777-4f6c-a4c5-57ef00f895c2",
  "ownershipPercentage": 40,
  "controlRole": "PARTNER"
}
```

`GET /api/entity/v1/entities/{companyId}/ubos` li elenca entrambi:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "items": [
    {
      "id": "37325b16-514f-40f5-afca-a2acd201f629",
      "companyId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "personId": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526",
      "ownershipPercentage": 60.0,
      "controlRole": "LEGAL_REPRESENTATIVE",
      "validFrom": "2024-01-15",
      "validTo": null,
      "createdAt": "2024-01-15T17:04:17Z"
    },
    {
      "id": "848b821f-1ebb-42cf-b4c1-634b5db579e6",
      "companyId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "personId": "c0b9c624-7777-4f6c-a4c5-57ef00f895c2",
      "ownershipPercentage": 40.0,
      "controlRole": "PARTNER",
      "validFrom": "2024-01-15",
      "validTo": null,
      "createdAt": "2024-01-15T17:04:18Z"
    }
  ]
}
```

Conserva l'`internalId` della società: identifica il beneficiario in Localpayment.

### Comunicare a Localpayment che il caricamento è completo

Quando la società, i suoi documenti e tutte le persone sono stati caricati e collegati, chiama `POST /api/entity/v1/entities/{companyId}/verify` sulla società ([Richiedere la verifica](https://docs.localpayment.com/it/reference/request-entity-verification.md)). In questo modo comunichi a Localpayment che il caricamento della documentazione è completo. La risposta è `202 Accepted` (estratto):

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "internalId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "type": "COMPANY",
  "status": "IN_REVIEW",
  "updatedAt": "2024-01-15T17:05:00Z"
}
```

Finché la società è `IN_REVIEW`, è bloccata (409 `ENTITY_IN_REVIEW`). Con `verify` la tua parte del caricamento termina: non è necessario interrogare successivamente lo stato dell'entità.

## Checklist

* Ogni documento che hai dichiarato (costituzione, origine dei fondi, documenti d'identità) ha i relativi file. Un documento principale di identificazione fiscale non richiede file.
* Ogni proprietario è collegato alla società con il suo `ownershipPercentage` e il rappresentante legale con `controlRole: LEGAL_REPRESENTATIVE`.
* `attributes.businessProfile` è impostato sulla società.
* Dopo aver caricato tutto, hai chiamato `verify` sulla società.
* I codici di identificazione fiscale contengono solo cifre e i nomi corrispondono esattamente ai documenti.
* Ogni file è in formato PDF, PNG, JPG o JPEG e ha dimensioni inferiori a 10 MB.

> [!NOTE]
>
> Una volta completata la checklist, Localpayment verifica la società e ogni persona e ti comunica se è necessario correggere qualcosa. Consulta [Monitorare la verifica e correggere i rifiuti](https://docs.localpayment.com/it/docs/track-review-and-fix-rejections.md).

## Passaggi successivi

> [card] [Monitorare la verifica e correggere i rifiuti](https://docs.localpayment.com/it/docs/track-review-and-fix-rejections.md)
>
> Segui la verifica e correggi ciò che Localpayment ti richiede.

> [card] [Gestire gli UBO](https://docs.localpayment.com/it/docs/manage-ubos.md)
>
> Aggiorna o termina i collegamenti con i proprietari.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.