# Credor

# Credor | Schema V1 | 2025 - ∞

##### **Tipo Envio: Diário**

---

##### **Objeto Raiz**

<table border="1" class="min-w-full border-collapse text-sm leading-[1.7] whitespace-normal" id="bkmrk-campo-informa%C3%A7%C3%B5es-ti" style="width: 100%; border-collapse: collapse; border-style: solid;"><thead><tr><td class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" style="width: 17.0413%;">**Campo**</td><td class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold" style="width: 82.9587%;">**Informações**</td></tr></thead><tbody><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 17.0413%;">`timestamp`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 82.9587%;">Campo utilizado para **ordenar** a validação das informações enviadas. Caso sejam enviados **múltiplos payloads** do mesmo tipo, a ordenação ocorrerá da **data mais antiga para a mais recente**</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 17.0413%;">`elementos`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 82.9587%;">–</td></tr></tbody></table>

---

##### **Item**  


<table class="min-w-full border-collapse text-sm leading-[1.7] whitespace-normal" id="bkmrk-campo-chave-informa%C3%A7" style="width: 90%; height: 155.516px;"><thead class="text-left"><tr style="height: 29.7969px;"><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold align-left" scope="col" style="width: 12.7152%; height: 29.7969px;">**Campo**</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold align-left" scope="col" style="width: 7.54967%; height: 29.7969px;">**Chave**</th><th class="text-text-100 border-b-0.5 border-border-300/60 py-2 pr-4 align-top font-bold align-left" scope="col" style="width: 79.7351%; height: 29.7969px;">**Informações**</th></tr></thead><tbody><tr style="height: 30.1094px;"><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 12.7152%; height: 30.1094px;">`cpfCnpj`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top align-center" style="width: 7.54967%; height: 30.1094px;">✅</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 79.7351%; height: 30.1094px;">–</td></tr><tr><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 12.7152%; height: 30.1094px;">`nome`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top align-center" style="width: 7.54967%; height: 30.1094px;">✅</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 79.7351%; height: 30.1094px;">–</td></tr><tr style="height: 35.3906px;"><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 12.7152%; height: 35.3906px;">`tipo`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top align-center" style="width: 7.54967%; height: 35.3906px;">–</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 79.7351%; height: 35.3906px;">**[Tabela Tipo Credor](https://docs.tcepb.tc.br/books/tabelas-de-dominio/page/tipo-credor)**</td></tr><tr style="height: 30.1094px;"><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 12.7152%; height: 30.1094px;">`action`</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top align-center" style="width: 7.54967%; height: 30.1094px;">–</td><td class="border-b-0.5 border-border-300/30 py-2 pr-4 align-top" style="width: 79.7351%; height: 30.1094px;">Define a operação a ser realizada com a informação, seja ela **criação, atualização ou exclusão**</td></tr></tbody></table>

---

##### **Regras**

<figure class="wp-block-table is-style-stripes" id="bkmrk-consulte-as-regras-d">[Consulte as regras de validação](https://docs.tcepb.tc.br/books/regras/page/credor-regras-vigencia-2025)

</figure>---

##### **Schema**

```
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Credor",
  "description": "Schema para envio de credores por unidade gestora",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])T([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d)\\.\\d{3,6}$",
      "examples": ["2025-09-11T15:30:00.123456"]
    },
    "elementos": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "cpfCnpj": {
            "type": "string",
            "minLength": 11,
            "maxLength": 14,
            "pattern": "^[A-Z0-9]+$"
          },
          "nome": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "tipo": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1,
            "pattern": "^[0-9]+$"
          },
          "action": {
            "type": "string",
            "enum": ["CREATE", "UPDATE", "DELETE"]
          }
        },
        "required": [
          "cpfCnpj",
          "nome",
          "tipo",
          "action"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": ["timestamp", "elementos"],
  "additionalProperties": false
}
```

---

##### **Exemplo de Payload**

```
{
  "timestamp": "2025-09-11T15:30:00.123456",
  "elementos": [
    {
      "cpfCnpjCredor": "12345678000199",
      "nomeCredor": "Empresa Fornecedora de Materiais LTDA",
      "tipoCredor": "1",
      "action": "CREATE"
    },
    {
      "cpfCnpjCredor": "98765432100",
      "nomeCredor": "João da Silva Pereira",
      "tipoCredor": "2",
      "action": "UPDATE"
    },
    {
      "cpfCnpjCredor": "11122233000177",
      "nomeCredor": "Construtora Municipal S.A.",
      "tipoCredor": "3",
      "action": "DELETE"
    }
  ]
}
```