# Pagamento Resto

# Pagamento Resto | Schema V1 | 2025 - ∞

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

---

##### **Objeto Raiz**

<figure class="wp-block-table is-style-stripes" id="bkmrk-campo-informa%C3%A7%C3%B5es-ti"><table class="has-fixed-layout" style="width: 100%;"><thead><tr><td style="width: 12.1549%;">**Campo**</td><td style="width: 87.8451%;">**Informações**</td></tr></thead><tbody><tr><td>`timestamp`</td><td>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 **<span style="color: rgb(186, 55, 42);">data mais antiga para a mais recente</span>**</td></tr><tr><td>`elementos`</td><td>–</td></tr></tbody></table>

</figure>---

##### **Item**

<figure class="wp-block-table is-style-stripes" id="bkmrk-campo-chave-informa%C3%A7"><table class="has-fixed-layout" style="width: 100%;"><thead><tr><td style="width: 30.9893%;">**Campo**</td><td style="width: 6.91299%;">**Chave**</td><td style="width: 62.0977%;">**Informações**</td></tr></thead><tbody><tr><td style="width: 30.9893%;">`anoEmissaoEmpenho`</td><td class="align-center" style="width: 6.91299%;">✅</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`codigoUnidadeOrcamentaria`</td><td class="align-center" style="width: 6.91299%;">✅</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`numeroEmpenho`</td><td class="align-center" style="width: 6.91299%;">✅</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`numeroPagamentoResto`</td><td class="align-center" style="width: 6.91299%;">✅</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`dataPagamentoResto`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`valorPagamentoResto`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`codigoBancoContaBancariaDebito`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`numeroContaBancariaDebito`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`numeroAgenciaContaBancariaDebito`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`tipoContaBancariaDebito`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`cnpjGerenciaContaBancariaDebito`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`numeroCheque`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`numeroDocDebito`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`codigoBancoContaBancariaCredito`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`numeroAgenciaContaBancariaCredito`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`numeroContaBancariaCredito`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`exercicioFonteRecurso`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">`Atual` / `Anterior`</td></tr><tr><td style="width: 30.9893%;">`codigoFonteRecurso`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">Definido pela Secretaria do Tesouro Nacional e disponibilizada pela Matriz de Saldos Contábeis - MSC</td></tr><tr><td style="width: 30.9893%;">`codigoCO`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">Definido pela Secretaria do Tesouro Nacional e disponibilizada pela Matriz de Saldos Contábeis - MSC</td></tr><tr><td style="width: 30.9893%;">`codigoUnidadeGestoraOrigem`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">–</td></tr><tr><td style="width: 30.9893%;">`action`</td><td class="align-center" style="width: 6.91299%;">–</td><td style="width: 62.0977%;">Define a operação a ser realizada com a informação, seja ela **criação, atualização ou exclusão**</td></tr></tbody></table>

</figure>---

##### **Schema**

```
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Lista de Pagamentos de Restos a Pagar",
  "description": "Lista de objetos representando a entidade Pagamento Resto",
  "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": {
        "title": "Pagamento Resto",
        "description": "Representa\u00e7\u00e3o do schema para envio da entidade Pagamento Resto",
        "type": "object",
        "properties": {
          "anoEmissaoEmpenho": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4,
            "pattern": "^[0-9]+$"
          },
          "codigoUnidadeOrcamentaria": {
            "type": "string",
            "minLength": 5,
            "maxLength": 5,
            "pattern": "^[0-9]+$"
          },
          "numeroEmpenho": {
            "type": "string",
            "minLength": 7,
            "maxLength": 7,
            "pattern": "^[0-9]+$"
          },
          "numeroPagamentoResto": {
            "type": "string",
            "minLength": 7,
            "maxLength": 7,
            "pattern": "^[0-9]+$"
          },
          "dataPagamentoResto": {
            "type": "string",
            "format": "date"
          },
          "valorPagamentoResto": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "codigoBancoContaBancariaDebito": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "pattern": "^[0-9]+$"
          },
          "numeroContaBancariaDebito": {
            "type": "string",
            "minLength": 13,
            "maxLength": 13,
            "pattern": "^[0-9]+$"
          },
          "numeroAgenciaContaBancariaDebito": {
            "type": "string",
            "minLength": 6,
            "maxLength": 6,
            "pattern": "^[0-9]+$"
          },
          "tipoContaBancariaDebito": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1,
            "pattern": "^[0-9]+$"
          },
          "cnpjGerenciaContaBancariaDebito": {
            "type": "string",
            "minLength": 14,
            "maxLength": 14,
            "pattern": "^[0-9]+$"
          },
          "numeroCheque": {
            "type": "string",
            "minLength": 6,
            "maxLength": 6,
            "pattern": "^[0-9]+$"
          },
          "numeroDocDebito": {
            "type": "string",
            "minLength": 11,
            "maxLength": 11,
            "pattern": "^[0-9]+$"
          },
          "codigoBancoContaBancariaCredito": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "pattern": "^[0-9]+$"
          },
          "numeroAgenciaContaBancariaCredito": {
            "type": "string",
            "minLength": 6,
            "maxLength": 6,
            "pattern": "^[0-9]+$"
          },
          "numeroContaBancariaCredito": {
            "type": "string",
            "minLength": 13,
            "maxLength": 13,
            "pattern": "^[0-9]+$"
          },
          "exercicioFonteRecurso": {
            "type": "string",
            "enum": ["ATUAL", "ANTERIOR"]
          },
          "codigoFonteRecurso": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "pattern": "^[0-9]+$"
          },
          "codigoCO": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4,
            "pattern": "^[0-9]+$"
          },
          "codigoUnidadeGestoraOrigem": {
            "type": "string",
            "minLength": 6,
            "maxLength": 6,
            "pattern": "^[0-9]+$"
          },
          "action": {
            "type": "string",
            "enum": ["CREATE", "UPDATE", "DELETE"]
          }
        },
        "required": [
          "anoEmissaoEmpenho",
          "codigoUnidadeOrcamentaria",
          "numeroEmpenho",
          "numeroPagamentoResto",
          "dataPagamentoResto",
          "valorPagamentoResto",
          "codigoBancoContaBancariaDebito",
          "numeroContaBancariaDebito",
          "numeroAgenciaContaBancariaDebito",
          "tipoContaBancariaDebito",
          "cnpjGerenciaContaBancariaDebito",
          "numeroCheque",
          "numeroDocDebito",
          "codigoBancoContaBancariaCredito",
          "numeroAgenciaContaBancariaCredito",
          "numeroContaBancariaCredito",
          "exercicioFonteRecurso",
          "codigoFonteRecurso",
          "codigoCO",
          "codigoUnidadeGestoraOrigem",
          "action"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": ["timestamp", "elementos"],
  "additionalProperties": false
}
```

---

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

```
{
  "timestamp": "2025-09-11T15:30:00.123456",
  "elementos": [
    {
      "anoEmissaoEmpenho": "2025",
      "codigoUnidadeOrcamentaria": "12345",
      "numeroEmpenho": "7654321",
      "numeroPagamentoResto": "1234567",
      "dataPagamentoResto": "2025-09-11",
      "valorPagamentoResto": 5000.00,
      "codigoBancoContaBancariaDebito": "001",
      "numeroContaBancariaDebito": "0001234567890",
      "numeroAgenciaContaBancariaDebito": "123456",
      "tipoContaBancariaDebito": "1",
      "cnpjGerenciaContaBancariaDebito": "00000000000000",
      "numeroCheque": "123456",
      "numeroDocDebito": "12345678901",
      "codigoBancoContaBancariaCredito": "341",
      "numeroAgenciaContaBancariaCredito": "654321",
      "numeroContaBancariaCredito": "0009876543210",
      "exercicioFonteRecurso": "1",
      "codigoFonteRecurso": "123",
      "codigoCO": "1234",
      "codigoUnidadeGestoraOrigem": "654321",
      "action": "CREATE"
    }
  ]
}
```