> For the complete documentation index, see [llms.txt](https://docs.certdox.com.br/gateway-de-registros/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.certdox.com.br/gateway-de-registros/reference/readme/registros.md). Agents can also search and read this documentation through its [MCP server](https://docs.certdox.com.br/gateway-de-registros/~gitbook/mcp).

# Registros

Solicitando um novo registro

<mark style="color:green;">`POST`</mark> `https://registroeletronico-homolog.cdxti.com.br/api/registration-requests-bulk`

#### Headers

| Name                                            | Type         | Description                              |
| ----------------------------------------------- | ------------ | ---------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer Token | Token gerado pelo método de autenticação |

#### Request Body

| Name                                                    | Type    | Description                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| partnerRegistrationId<mark style="color:red;">\*</mark> | string  | Id do registro no sistema do parceiro. Deve ser ÚNICO e controlado pelo cliente.                                                                                                                                                                                                                           |
| customerIdentifier<mark style="color:red;">\*</mark>    | string  | CNPJ do cliente para qual o registro será realizado                                                                                                                                                                                                                                                        |
| clientName                                              | string  | Nome do titular do registro                                                                                                                                                                                                                                                                                |
| clientIdentifier                                        | string  | CPF/CNPJ do titular do registro                                                                                                                                                                                                                                                                            |
| email                                                   | string  | Email do titular do registro                                                                                                                                                                                                                                                                               |
| phone                                                   | string  | Telefone do titular do registro                                                                                                                                                                                                                                                                            |
| contractNumber<mark style="color:red;">\*</mark>        | string  | Id do contrato do titular do registro                                                                                                                                                                                                                                                                      |
| contractId                                              | string  | Número/referência de controle do cliente                                                                                                                                                                                                                                                                   |
| registerTypes<mark style="color:red;">\*</mark>         | array   | Tipo do pedido de registro                                                                                                                                                                                                                                                                                 |
| additionalInformation                                   | string  | Campo para inserir informações adicionais do pedido de registro                                                                                                                                                                                                                                            |
| rgiBoletoClientName                                     | boolean | Define em nome de quem o boleto de emolumentos será emitido. Aplicável apenas a registros RGI (**serviceType** = `RGI` em **registerTypes**). `false` (padrão) ou ausente: boleto em nome da conveniada CertDox. `true`: boleto em nome do pagador informado em `boletoPayer`e`boletoPayerIdentifier`      |
| boletoPayer                                             | string  | Nome do pagador (sacado) do boleto. Obrigatório se `rgiBoletoClientName` = true.                                                                                                                                                                                                                           |
| boletoPayerIdentifier                                   | string  | CPF ou CNPJ do sacado do boleto, sem pontuação e com dígitos verificadores válidos. Obrigatório se `rgiBoletoClientName` = true                                                                                                                                                                            |
| boletoAddress                                           | string  | Endereço (logradouro) do sacado do boleto. Obrigatório se `rgiBoletoClientName` = true.                                                                                                                                                                                                                    |
| boletoNumber                                            | string  | Número do endereço do sacado do boleto. Obrigatório se `rgiBoletoClientName` = true.                                                                                                                                                                                                                       |
| boletoComplement                                        | string  | Complemento do endereço do sacado do boleto. Opcional, mesmo com `rgiBoletoClientName` = true.                                                                                                                                                                                                             |
| boletoNeighborhood                                      | string  | Bairro do sacado do boleto. Obrigatório se `rgiBoletoClientName` = true.                                                                                                                                                                                                                                   |
| boletoCEP                                               | string  | CEP do sacado do boleto. Obrigatório se `rgiBoletoClientName` = true                                                                                                                                                                                                                                       |
| boletoUF                                                | string  | Sigla do estado do sacado do boleto, 2 letras maiúsculas (ex.: SP). Obrigatório se `rgiBoletoClientName` = true                                                                                                                                                                                            |
| boletoCity                                              | string  | Município do sacado do boleto. Obrigatório se `rgiBoletoClientName` = true.                                                                                                                                                                                                                                |
| procedureType<mark style="color:red;">\*</mark>         | string  | Tipo de procedimento (REGISTRO\|ASSINATURA\_REGISTRO)                                                                                                                                                                                                                                                      |
| organization<mark style="color:red;">\*</mark>          | object  | Organização do parceiro. Ver **Organization - Schema**.                                                                                                                                                                                                                                                    |
| participants                                            | array   | Lista de partes que fazem parte do registro. Obrigatório quando **procedureType** = `ASSINATURA_REGISTRO`. Ver **Participant - Schema**. Os valores aceitos em `title` estão em [Títulos de Participantes](https://docs.certdox.com.br/gateway-de-registros/reference/readme/titulos-de-participantes.md). |
| documents<mark style="color:red;">\*</mark>             | array   | Documentos que serão registrados no cartório. Ver **Document - Schema**. A `documentUrl` de cada documento deve ser gerada pelo endpoint [URL de Documento](https://docs.certdox.com.br/gateway-de-registros/reference/readme/url-de-documento.md).                                                        |

{% tabs %}
{% tab title="200: OK OK" %}

```javascript
[
    {
        "id": "4164",
        "partnerRegistrationId": "00000000000000000001",
        "customerIdentifier": "20061411000102",
        "status": "SUCCESS",
        "message": "Registration accepted"
    },
    {
        "id": null,
        "partnerRegistrationId": "00000000000000000001",
        "customerIdentifier": "20061411000102",
        "status": "FAIL",
        "message": "Principal document not informed"
    }
]
```

{% endtab %}

{% tab title="400: Bad Request Bad request" %}

```javascript
{
    "type": "https://registroeletronico.certdox.com.br/problem/constraint-violation",
    "title": "Constraint Violation",
    "status": 400,
    "path": "/api/registration-requests-bulk",
    "violations": [
        {
            "field": "createRegistrationRequestBulk.registrationRequests[0].partnerRegistrationId",
            "message": "must not be null"
        }
    ],
    "message": "error.validation"
}
```

{% endtab %}

{% tab title="401: Unauthorized Permission denied" %}
Token ausente ou inválido. Gere um token pelo endpoint de [Autenticação](https://docs.certdox.com.br/gateway-de-registros/reference/readme/autenticacao.md).
{% endtab %}
{% endtabs %}

#### Organization - Schema

```json
{
    "identifier": "00000000000000" // CNPJ | String | Required | mix = 14, max = 14
}
```

#### Participant - Schema

```json
{
    "name": "Participante Um", // String | Required | max = 50
    "identifier": "00000000001", // CPF | String | Required | min = 11, max = 11
    "documentType": "CPF", // String | Required | values = {CPF}
    "qualifier": "ASSINADOR", // String | Required | values = { ASSINADOR | APROVADOR }
    "phoneNumber": "4199999999", // String | Required
    "hasCertificate": true, // Boolean | Required
    "hasDriverLicense": false, // Boolean | Required
    "certificateType": "ICP", // String | Optional | values = { ICP | IDRC } | Tipo de certificado com que o participante assina (ICP-Brasil ou IdRC); qualifier APROVADOR não pode ser IDRC
    "step": 1, // Integer | Required if "certificateType" = IDRC | min = 1 | Ordem de assinatura do participante; participante IDRC precisa de um step exclusivo, participantes ICP podem compartilhar o mesmo step; precisa ser inteiro JSON (decimal ou texto são rejeitados)
    "email": "representanteum@organization.com.br" // String | Required | max = 50,
    "title": "SIGNATARIO" // String | See paticipant title list Ex.: { CLIENTE | COMPRADOR | DEVEDOR | ...}
}
```

#### Document - Schema

```json
{
    "isPrincipal": true, // Boolean | Required
    "documentType": "CPR", // String | Required | values = {CPR|CCB|CCI|CONTRATO|OUTROS}
    "documentUrl": "https://www.url.com.br/doc.pdf" // Presigned URL generated by 'URL de Documento' endpoint
}
```

#### RegisterType - Schema

```json
[
    {
        "serviceType": "RTD", // String | Required | values = {RGI|RTD}
        "ibgeCode": "400120", // String | Required | max = 20
        "cnsRegistry": "097667" // String | Required | max = 10
    }
]
```

#### Exemplo de Payload Completo

```json
[
    {
        "organization": {
            "identifier": "00000000000000" // CNPJ do parceiro
        },
        "partnerRegistrationId": "18238167237678130",
        "customerIdentifier": "00000000000000",
        "clientName": "TITULAR DO REGISTRO", // Nome do titular do registro
        "clientIdentifier": "00000000000000", // CPF/CNPJ do titular do registro
        "email": "titular@organization.com.br", //email do titular do registro
        "phone": "4199999999", //telefone do titular do registro
        "contractId": "12345", //id do contrato do titular do registro
        "contractNumber": "12356789", //número do contrato emitido pelo cliente
        "additionalInformation": "Informações adicionais do pedido de registro", //informações adicionais do pedido de registro  
        "rgiBoletoClientName": true, // Boolean | Optional | default = false | Only for "serviceType" = RGI; com true, boletoPayer, boletoPayerIdentifier e os campos boleto* abaixo são obrigatórios (exceto boletoComplement)
        "boletoPayer": "PAGADOR DO BOLETO", // max = 100
        "boletoPayerIdentifier": "12345678909", // CPF (11 dígitos) ou CNPJ (14 caracteres), sem pontuação e com dígitos verificadores válidos
        "boletoAddress": "Rua das Flores", // max = 45
        "boletoNumber": "100", // max = 5
        "boletoComplement": "Apto 12", // Optional | max = 15
        "boletoNeighborhood": "Centro", // max = 25
        "boletoCEP": "01001000", // 8 dígitos, sem máscara
        "boletoUF": "SP", // 2 letras maiúsculas
        "boletoCity": "São Paulo", // max = 60
        
        "registerTypes": [
            {
                "serviceType": "RGI",
                "ibgeCode": "400120",
                "cnsRegistry": "097667" 
            }
        ],
        "procedureType": "ASSINATURA_REGISTRO", // String | Required | values = {REGISTRO|ASSINATURA_REGISTRO}
        "participants": [ // Required if "procedureType" = ASSINATURA_REGISTRO
            {
                "name": "Participante Um",
                "identifier": "00000000001",
                "documentType": "CPF",
                "qualifier": "ASSINADOR",
                "phoneNumber": "4199999999",
                "hasCertificate": true,
                "hasDriverLicense": false,
                "certificateType": "ICP",
                "step": 1, // Participantes ICP podem compartilhar o mesmo step
                "email": "representanteum@organization.com.br",
                "title": "SIGNATARIO"
            },
            {
                "name": "Participante Dois",
                "identifier": "00000000002",
                "documentType": "CPF",
                "qualifier": "ASSINADOR",
                "phoneNumber": "4199999999",
                "hasCertificate": true,
                "hasDriverLicense": false,
                "certificateType": "ICP",
                "step": 1,
                "email": "representantedois@organization.com.br",
                "title": "SIGNATARIO"
            },
            {
                "name": "Participante Tres",
                "identifier": "00000000003",
                "documentType": "CPF",
                "qualifier": "ASSINADOR",
                "phoneNumber": "4199999999",
                "hasCertificate": true,
                "hasDriverLicense": false,
                "certificateType": "IDRC",
                "step": 2, // Obrigatório para IDRC, em um step exclusivo
                "email": "representantetres@organization.com.br",
                "title": "SIGNATARIO"
            }
        ],
        "documents": [
            {
                "isPrincipal": true, // Only one main document (isPrincipal=true) is allowed
                "documentType": "CPR", 
                "documentUrl": "https://www.url.com.br/doc.pdf"
            },
            {
                "isPrincipal": false,
                "documentType": "OUTROS",
                "documentUrl": "https://www.url.com.br/doc.pdf"
            },
            {
                "isPrincipal": false,
                "documentType": "OUTROS",
                "documentUrl": "https://www.url.com.br/doc.pdf"
            }
        ]
    }
]
```

{% hint style="info" %}
O atributo **partnerRegistrationId** é obrigatório e deve ser único. O controle de unicidade deve ser feito pelo consumidor da API.
{% endhint %}

{% hint style="info" %}

## Informação sobre os dados do titular do registro

Para que os dados do titular do registro sejam considerados durante o processamento da requisição, é obrigatório o envio conjunto dos campos **clientName** e **clientIdentifier**. Caso um ou ambos os campos estejam ausentes, as informações do titular serão desconsideradas.
{% endhint %}

{% hint style="info" %}

## Emissão do boleto

O campo **rgiBoletoClientName** vale apenas para registros RGI (**serviceType** = `RGI` em **registerTypes**) e define em nome de quem o boleto será emitido:

* `false` (padrão) → boleto emitido em nome da conveniada CertDox; campos do pagador e de endereço não obrigatórios.
* `true` → boleto emitido em nome do pagador informado em **boletoPayer** (nome) e **boletoPayerIdentifier** (CPF/CNPJ). Esses dois campos e os de endereço (**boletoAddress**, **boletoNumber**, **boletoNeighborhood**, **boletoCEP**, **boletoCity** e **boletoUF**) tornam-se obrigatórios. **boletoComplement** continua opcional.

O pagador do boleto não precisa ser o titular do registro: **clientName** e **clientIdentifier** não são usados no boleto e continuam opcionais.

Se faltar algum campo obrigatório, ou se algum valor estiver fora do formato ou acima do tamanho máximo, a requisição inteira retorna `400`, sem gravar nenhum item. O `400` traz um item em `violations` por campo e, quando há campo ausente, um `detail` com a lista dos campos que faltam em cada item do lote. Um **boletoPayerIdentifier** com formato ou dígito verificador inválido retorna `must be a valid CPF (11 digits) or CNPJ (14 characters)`.
{% endhint %}
