{
  "info": {
    "name": "Valloria Nexus External API",
    "_postman_id": "0e87f094-cf67-4b26-894c-7f0b4e3e51e0",
    "description": "Collection da API External da Valloria Nexus para statements, schedules, runs e consumo normalizado.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{ACCESS_TOKEN}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "AUTH_BASE_URL",
      "value": "https://auth.valloria.com",
      "type": "string"
    },
    {
      "key": "API_BASE_URL",
      "value": "https://api.valloria.com",
      "type": "string"
    },
    {
      "key": "ACCESS_TOKEN",
      "value": "",
      "type": "string"
    },
    {
      "key": "BANK_CODE",
      "value": "ITAU",
      "type": "string"
    },
    {
      "key": "ENVIRONMENT",
      "value": "sandbox",
      "type": "string"
    },
    {
      "key": "SCHEDULE_ID",
      "value": "f5a8c4dd-f8d9-4b8f-bf7f-428aeb190d39",
      "type": "string"
    },
    {
      "key": "RUN_ID",
      "value": "run_demo_001",
      "type": "string"
    },
    {
      "key": "ACCOUNT_ID",
      "value": "acc_demo_001",
      "type": "string"
    },
    {
      "key": "DATE_FROM",
      "value": "2026-03-01",
      "type": "string"
    },
    {
      "key": "DATE_TO",
      "value": "2026-03-10",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Authentication",
      "item": [
        {
          "name": "Issue Access Token",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/x-www-form-urlencoded"
              }
            ],
            "body": {
              "mode": "urlencoded",
              "urlencoded": [
                {
                  "key": "grant_type",
                  "value": "client_credentials",
                  "type": "text"
                },
                {
                  "key": "client_id",
                  "value": "client_demo",
                  "type": "text"
                },
                {
                  "key": "client_secret",
                  "value": "secret_demo",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{AUTH_BASE_URL}}/v1/auth/token",
              "host": [
                "{{AUTH_BASE_URL}}"
              ],
              "path": [
                "v1",
                "auth",
                "token"
              ]
            },
            "description": "Emite um Bearer JWT usando client_credentials."
          }
        }
      ]
    },
    {
      "name": "Preflight",
      "item": [
        {
          "name": "Bank Preflight",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/banks/{{BANK_CODE}}/preflight?environment={{ENVIRONMENT}}",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "banks",
                "{{BANK_CODE}}",
                "preflight"
              ],
              "query": [
                {
                  "key": "environment",
                  "value": "{{ENVIRONMENT}}"
                }
              ]
            },
            "description": "Valida se a configuracao bancaria do tenant esta pronta."
          }
        }
      ]
    },
    {
      "name": "Schedules",
      "item": [
        {
          "name": "Create Schedule",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"bank_code\": \"{{BANK_CODE}}\",\n  \"environment\": \"{{ENVIRONMENT}}\",\n  \"account_id\": \"{{ACCOUNT_ID}}\",\n  \"run_times\": [\"09:00\", \"18:00\"],\n  \"timezone\": \"America/Sao_Paulo\",\n  \"retention_days\": 30,\n  \"webhook_enabled\": false,\n  \"enabled\": true\n}"
            },
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/schedules",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "schedules"
              ]
            }
          }
        },
        {
          "name": "List Schedules",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/schedules",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "schedules"
              ]
            }
          }
        },
        {
          "name": "Get Schedule",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/schedules/{{SCHEDULE_ID}}",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "schedules",
                "{{SCHEDULE_ID}}"
              ]
            }
          }
        },
        {
          "name": "Get Next Schedule Run",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/schedules/{{SCHEDULE_ID}}/next",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "schedules",
                "{{SCHEDULE_ID}}",
                "next"
              ]
            }
          }
        },
        {
          "name": "Update Schedule",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"bank_code\": \"{{BANK_CODE}}\",\n  \"environment\": \"{{ENVIRONMENT}}\",\n  \"account_id\": \"{{ACCOUNT_ID}}\",\n  \"run_times\": [\"09:00\", \"18:00\"],\n  \"timezone\": \"America/Sao_Paulo\",\n  \"retention_days\": 30,\n  \"webhook_enabled\": false,\n  \"enabled\": true\n}"
            },
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/schedules/{{SCHEDULE_ID}}",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "schedules",
                "{{SCHEDULE_ID}}"
              ]
            }
          }
        },
        {
          "name": "Toggle Schedule",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enabled\": false\n}"
            },
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/schedules/{{SCHEDULE_ID}}/toggle",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "schedules",
                "{{SCHEDULE_ID}}",
                "toggle"
              ]
            }
          }
        },
        {
          "name": "Run Active Schedules",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/schedules/run",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "schedules",
                "run"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Runs",
      "item": [
        {
          "name": "List Runs",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/runs?account_id={{ACCOUNT_ID}}&date_from={{DATE_FROM}}&date_to={{DATE_TO}}",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "runs"
              ],
              "query": [
                {
                  "key": "account_id",
                  "value": "{{ACCOUNT_ID}}"
                },
                {
                  "key": "date_from",
                  "value": "{{DATE_FROM}}"
                },
                {
                  "key": "date_to",
                  "value": "{{DATE_TO}}"
                }
              ]
            }
          }
        },
        {
          "name": "Get Run",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/runs/{{RUN_ID}}",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "runs",
                "{{RUN_ID}}"
              ]
            }
          }
        },
        {
          "name": "Download Run Artifact",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/runs/{{RUN_ID}}/download",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "runs",
                "{{RUN_ID}}",
                "download"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Consumption",
      "item": [
        {
          "name": "Availability",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/availability?account_id={{ACCOUNT_ID}}&date_from={{DATE_FROM}}&date_to={{DATE_TO}}",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "availability"
              ],
              "query": [
                {
                  "key": "account_id",
                  "value": "{{ACCOUNT_ID}}"
                },
                {
                  "key": "date_from",
                  "value": "{{DATE_FROM}}"
                },
                {
                  "key": "date_to",
                  "value": "{{DATE_TO}}"
                }
              ]
            }
          }
        },
        {
          "name": "Query Statements",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/query?account_id={{ACCOUNT_ID}}&date_from={{DATE_FROM}}&date_to={{DATE_TO}}",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "query"
              ],
              "query": [
                {
                  "key": "account_id",
                  "value": "{{ACCOUNT_ID}}"
                },
                {
                  "key": "date_from",
                  "value": "{{DATE_FROM}}"
                },
                {
                  "key": "date_to",
                  "value": "{{DATE_TO}}"
                }
              ]
            }
          }
        },
        {
          "name": "Query Balances",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/balances?account_id={{ACCOUNT_ID}}&date_from={{DATE_FROM}}&date_to={{DATE_TO}}",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "balances"
              ],
              "query": [
                {
                  "key": "account_id",
                  "value": "{{ACCOUNT_ID}}"
                },
                {
                  "key": "date_from",
                  "value": "{{DATE_FROM}}"
                },
                {
                  "key": "date_to",
                  "value": "{{DATE_TO}}"
                }
              ]
            }
          }
        },
        {
          "name": "Overview",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{API_BASE_URL}}/v1/statements/overview?account_id={{ACCOUNT_ID}}&date_from={{DATE_FROM}}&date_to={{DATE_TO}}",
              "host": [
                "{{API_BASE_URL}}"
              ],
              "path": [
                "v1",
                "statements",
                "overview"
              ],
              "query": [
                {
                  "key": "account_id",
                  "value": "{{ACCOUNT_ID}}"
                },
                {
                  "key": "date_from",
                  "value": "{{DATE_FROM}}"
                },
                {
                  "key": "date_to",
                  "value": "{{DATE_TO}}"
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
