# Registros

## Solicitando um novo registro

## Criar solicitações de registro em lote

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

Cria um lote de solicitações de registro

#### Headers

| Name          | Type         | Description                              |
| ------------- | ------------ | ---------------------------------------- |
| Authorization | 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                                                  |
| ibgeCode<mark style="color:red;">\*</mark>              | string | Código IBGE do município do cliente                                              |
| contractNumber<mark style="color:red;">\*</mark>        | string | Número do contrato emitido pelo cliente                                          |
| registerTypes<mark style="color:red;">\*</mark>         | array  | Tipo do pedido de registro                                                       |
| procedureType<mark style="color:red;">\*</mark>         | string | Tipo de procedimento (REGISTRO\|ASSINATURA\_REGISTRO)                            |
| organization<mark style="color:red;">\*</mark>          | object | Organização do parceiro                                                          |
| participants<mark style="color:red;">\*</mark>          | array  | Lista de partes que fazem parte do registro.                                     |
| documents<mark style="color:red;">\*</mark>             | array  | Documentos que serão registrados no cartório                                     |

{% 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://zalando.github.io/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" %}

{% 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
    "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
    }
]
```

#### 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
        "contractNumber": "12356789",
        "registerTypes": [
            {
                "serviceType": "RGI",
                "ibgeCode": "400120"
            }
        ],
        "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,
                "email": "representanteum@organization.com.br",
                "title": "SIGNATARIO"
            },
            {
                "name": "Participante Dois",
                "identifier": "00000000002",
                "documentType": "CPF",
                "qualifier": "ASSINADOR",
                "phoneNumber": "4199999999",
                "hasCertificate": true,
                "hasDriverLicense": false,
                "email": "representantedois@organization.com.br",
                "title": "SIGNATARIO"
            },
            {
                "name": "Participante Tres",
                "identifier": "00000000003",
                "documentType": "CPF",
                "qualifier": "ASSINADOR",
                "phoneNumber": "4199999999",
                "hasCertificate": true,
                "hasDriverLicense": false,
                "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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.certdox.com.br/gateway-de-registros/reference/readme/registros.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
