{
  "info": {
    "_postman_id": "95f4e218-852a-425f-b6f9-2992615ca91b",
    "name": "Uwata API v1",
    "description": "Colecção oficial da API Uwata. Importa esta colecção no Postman para testar todos os endpoints.\n\nConfigura as variáveis de ambiente:\n- `base_url`: https://api.uwata.app/api/v1\n- `api_key`: sk_live_... ou sk_test_...\n- `company_id`: ID da tua empresa",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "version": "1.2.0"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.uwata.app/api/v1",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "sk_live_SEU_TOKEN_AQUI",
      "type": "string"
    },
    {
      "key": "company_id",
      "value": "SEU_COMPANY_ID",
      "type": "string"
    },
    {
      "key": "invoice_id",
      "value": "INVOICE_ID",
      "type": "string"
    },
    {
      "key": "client_id",
      "value": "CLIENT_ID",
      "type": "string"
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Public API v1 — Invoices",
      "item": [
        {
          "name": "Listar facturas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/invoices",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "invoices"
              ]
            },
            "description": "Lista as facturas da empresa associada à API Key, com paginação e filtros."
          },
          "response": []
        },
        {
          "name": "Detalhes de uma factura",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/invoices/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "invoices",
                "{{client_id}}"
              ]
            },
            "description": "Detalhes de uma factura"
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Public API v1 — Invoices"
    },
    {
      "name": "Public API v1 — Clients",
      "item": [
        {
          "name": "Listar clientes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/clients",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "clients"
              ]
            },
            "description": "Lista os clientes da empresa associada à API Key."
          },
          "response": []
        },
        {
          "name": "Criar cliente",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/clients",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "clients"
              ]
            },
            "description": "Cria um novo cliente na empresa. Requer o scope clients:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"companyId\": \"<companyId>\",\n  \"name\": \"<name>\",\n  \"nif\": \"<nif>\",\n  \"tradeName\": \"<tradeName>\",\n  \"address\": \"<address>\",\n  \"city\": \"<city>\",\n  \"province\": \"<province>\",\n  \"country\": \"<country>\",\n  \"email\": \"<email>\",\n  \"phone\": \"<phone>\",\n  \"category\": \"<category>\",\n  \"notes\": \"<notes>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Detalhes de um cliente",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/v1/clients/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "clients",
                "{{client_id}}"
              ]
            },
            "description": "Detalhes de um cliente"
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Public API v1 — Clients"
    },
    {
      "name": "Developer — API Keys",
      "item": [
        {
          "name": "Criar nova API Key",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/developer/api-keys",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "developer",
                "api-keys"
              ]
            },
            "description": "Gera uma nova chave de API para integração. O token completo é retornado UMA VEZ e não pode ser recuperado depois.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"<name>\",\n  \"mode\": \"<mode>\",\n  \"scopes\": [],\n  \"companyId\": \"<companyId>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Listar API Keys da empresa",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/developer/api-keys/{{company_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "developer",
                "api-keys",
                "{{company_id}}"
              ]
            },
            "description": "Lista todas as chaves activas da empresa. Os tokens são mascarados."
          },
          "response": []
        },
        {
          "name": "Revogar API Key",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/developer/api-keys/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "developer",
                "api-keys",
                "{{client_id}}"
              ]
            },
            "description": "Revoga imediatamente uma chave de API. Esta acção é irreversível."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Developer — API Keys"
    },
    {
      "name": "Health",
      "item": [
        {
          "name": "Verifica o estado da API",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/health",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "health"
              ]
            },
            "description": "Endpoint público para verificar o estado e disponibilidade da API."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Health"
    },
    {
      "name": "Admin",
      "item": [
        {
          "name": "Obter métricas globais",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/metrics",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "metrics"
              ]
            },
            "description": "Retorna todas as métricas agregadas do Super Admin Dashboard."
          },
          "response": []
        },
        {
          "name": "Obter métricas de empresas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/metrics/companies",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "metrics",
                "companies"
              ]
            },
            "description": "Retorna apenas as métricas de empresas."
          },
          "response": []
        },
        {
          "name": "Obter métricas de facturação",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/metrics/billing",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "metrics",
                "billing"
              ]
            },
            "description": "Retorna apenas as métricas de volume de facturação."
          },
          "response": []
        },
        {
          "name": "Obter métricas de MRR",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/metrics/mrr",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "metrics",
                "mrr"
              ]
            },
            "description": "Retorna apenas as métricas de MRR (Monthly Recurring Revenue)."
          },
          "response": []
        },
        {
          "name": "Obter métricas de compliance",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/metrics/compliance",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "metrics",
                "compliance"
              ]
            },
            "description": "Retorna métricas de compliance fiscal (SAF-T, transmissões AGT)."
          },
          "response": []
        },
        {
          "name": "Listar empresas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/companies",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "companies"
              ]
            },
            "description": "Retorna lista paginada de empresas para o Super Admin."
          },
          "response": []
        },
        {
          "name": "Log de transmissões SAF-T",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/saft-log",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "saft-log"
              ]
            },
            "description": "Retorna o log paginado de transmissões SAF-T e batches AGT."
          },
          "response": []
        },
        {
          "name": "Log de auditoria",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/audit-log",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "audit-log"
              ]
            },
            "description": "Retorna o log paginado de auditoria da plataforma."
          },
          "response": []
        },
        {
          "name": "Listar planos",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/plans",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "plans"
              ]
            },
            "description": "Retorna todos os planos configurados na base de dados."
          },
          "response": []
        },
        {
          "name": "Criar plano",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/plans",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "plans"
              ]
            },
            "description": "Cria um novo plano na base de dados."
          },
          "response": []
        },
        {
          "name": "Actualizar plano",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/plans/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "plans",
                "{{client_id}}"
              ]
            },
            "description": "Actualiza um plano existente na base de dados."
          },
          "response": []
        },
        {
          "name": "Desactivar plano",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/plans/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "plans",
                "{{client_id}}"
              ]
            },
            "description": "Desactiva um plano na base de dados (soft delete)."
          },
          "response": []
        },
        {
          "name": "Criar séries de facturação em falta",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/fix-invoice-series",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "fix-invoice-series"
              ]
            },
            "description": "Cria séries de facturação para todas as empresas que não as têm configuradas."
          },
          "response": []
        },
        {
          "name": "Verificar estado do módulo Admin",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/health",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "health"
              ]
            },
            "description": "Health check do módulo Admin."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Admin"
    },
    {
      "name": "Admin — Platform Config",
      "item": [
        {
          "name": "Obter configurações de plataforma",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/platform-config",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "platform-config"
              ]
            },
            "description": "Retorna o estado das credenciais Resend e Infobip. As chaves API são mascaradas."
          },
          "response": []
        },
        {
          "name": "Configurar Resend (email)",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/platform-config/resend",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "platform-config",
                "resend"
              ]
            },
            "description": "Actualiza a API Key, email de origem e nome de origem do Resend.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Configurar Infobip (WhatsApp)",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/admin/platform-config/infobip",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "admin",
                "platform-config",
                "infobip"
              ]
            },
            "description": "Actualiza a API Key, Base URL e número WhatsApp do Infobip.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Admin — Platform Config"
    },
    {
      "name": "Auth",
      "item": [
        {
          "name": "Sincroniza utilizador Firebase",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/firebase-sync",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "firebase-sync"
              ]
            },
            "description": "Verifica o token do Firebase e cria/atualiza o utilizador na base de dados.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"firebaseUid\": \"<firebaseUid>\",\n  \"email\": \"<email>\",\n  \"displayName\": \"<displayName>\",\n  \"avatarUrl\": \"<avatarUrl>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Regista um novo utilizador",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/register",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "register"
              ]
            },
            "description": "Cria uma nova conta de utilizador.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"<email>\",\n  \"password\": \"<password>\",\n  \"displayName\": \"<displayName>\",\n  \"phone\": \"<phone>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Inicia sessão",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/login",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "login"
              ]
            },
            "description": "Autentica um utilizador e retorna tokens de acesso.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"<email>\",\n  \"password\": \"<password>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Atualiza tokens de acesso",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/refresh",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "refresh"
              ]
            },
            "description": "Gera um novo par de tokens de acesso e atualização.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refreshToken\": \"<refreshToken>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Termina a sessão",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/logout",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "logout"
              ]
            },
            "description": "Invalida os tokens de acesso do utilizador."
          },
          "response": []
        },
        {
          "name": "Obtém o perfil do utilizador",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/me",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "me"
              ]
            },
            "description": "Retorna os dados do utilizador autenticado."
          },
          "response": []
        },
        {
          "name": "Verifica o e-mail",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/verify-email",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "verify-email"
              ]
            },
            "description": "Confirma o endereço de e-mail do utilizador usando um token.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"token\": \"<token>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Reenvia a verificação de e-mail",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/resend-verification",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "resend-verification"
              ]
            },
            "description": "Envia novamente o e-mail de verificação."
          },
          "response": []
        },
        {
          "name": "Recupera a palavra-passe",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/forgot-password",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "forgot-password"
              ]
            },
            "description": "Envia um e-mail para recuperação de palavra-passe.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"<email>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Redefine a palavra-passe",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/reset-password",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "reset-password"
              ]
            },
            "description": "Redefine a palavra-passe do utilizador usando um token.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"token\": \"<token>\",\n  \"newPassword\": \"<newPassword>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Altera a palavra-passe (autenticado)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/auth/change-password",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "auth",
                "change-password"
              ]
            },
            "description": "Permite que um utilizador autenticado altere a sua própria palavra-passe.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"currentPassword\": \"<currentPassword>\",\n  \"newPassword\": \"<newPassword>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Auth"
    },
    {
      "name": "Cancellation",
      "item": [
        {
          "name": "Cancelar fatura e gerar Nota de Crédito",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/cancellation/{{invoice_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "cancellation",
                "{{invoice_id}}"
              ]
            },
            "description": "Cancela uma fatura emitida e gera automaticamente a respetiva Nota de Crédito.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"<reason>\",\n  \"reasonDescription\": \"<reasonDescription>\",\n  \"agtRulesConfirmed\": false,\n  \"clientEmail\": \"<clientEmail>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Obter dados para reconhecimento de anulação",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/cancellation/acknowledge/{token}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "cancellation",
                "acknowledge",
                "{token}"
              ]
            },
            "description": "Endpoint público para obter os dados da anulação para a página de reconhecimento."
          },
          "response": []
        },
        {
          "name": "Registar reconhecimento de anulação",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/cancellation/acknowledge/{token}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "cancellation",
                "acknowledge",
                "{token}"
              ]
            },
            "description": "Endpoint público que regista o reconhecimento da anulação pelo cliente.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"acknowledgedByName\": \"<acknowledgedByName>\",\n  \"acknowledgedByEmail\": \"<acknowledgedByEmail>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Cancellation"
    },
    {
      "name": "Companies",
      "item": [
        {
          "name": "Criar nova empresa",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies"
              ]
            },
            "description": "Cria uma nova empresa e associa o utilizador autenticado como OWNER.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"legalName\": \"<legalName>\",\n  \"tradeName\": \"<tradeName>\",\n  \"nif\": \"<nif>\",\n  \"caeCode\": \"<caeCode>\",\n  \"caeDescription\": \"<caeDescription>\",\n  \"vatRegime\": \"<vatRegime>\",\n  \"taxAddress\": \"<taxAddress>\",\n  \"city\": \"<city>\",\n  \"province\": \"<province>\",\n  \"email\": \"<email>\",\n  \"phone\": \"<phone>\",\n  \"website\": \"<website>\",\n  \"logoUrl\": \"<logoUrl>\",\n  \"bankName\": \"<bankName>\",\n  \"bankAccountIban\": \"<bankAccountIban>\",\n  \"invoiceStartNumber\": 0,\n  \"defaultPaymentDays\": 0,\n  \"defaultFooterNote\": \"<defaultFooterNote>\",\n  \"currency\": \"<currency>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Listar empresas do utilizador",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/mine",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                "mine"
              ]
            },
            "description": "Lista todas as empresas às quais o utilizador autenticado está associado."
          },
          "response": []
        },
        {
          "name": "Detalhes de uma empresa",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                "{{client_id}}"
              ]
            },
            "description": "Retorna os detalhes completos de uma empresa pelo seu ID."
          },
          "response": []
        },
        {
          "name": "Actualizar uma empresa",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                "{{client_id}}"
              ]
            },
            "description": "Actualiza os dados de uma empresa existente.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"legalName\": \"<legalName>\",\n  \"tradeName\": \"<tradeName>\",\n  \"caeCode\": \"<caeCode>\",\n  \"caeDescription\": \"<caeDescription>\",\n  \"vatRegime\": \"<vatRegime>\",\n  \"taxAddress\": \"<taxAddress>\",\n  \"city\": \"<city>\",\n  \"province\": \"<province>\",\n  \"email\": \"<email>\",\n  \"phone\": \"<phone>\",\n  \"website\": \"<website>\",\n  \"logoUrl\": \"<logoUrl>\",\n  \"bankName\": \"<bankName>\",\n  \"bankAccountIban\": \"<bankAccountIban>\",\n  \"defaultFooterNote\": \"<defaultFooterNote>\",\n  \"currency\": \"<currency>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Limites do plano",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/{{client_id}}/plan-limits",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                "{{client_id}}",
                "plan-limits"
              ]
            },
            "description": "Retorna os limites do plano activo e a utilização actual da empresa."
          },
          "response": []
        },
        {
          "name": "Configurar chaves AGT",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/{{client_id}}/agt-keys",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                "{{client_id}}",
                "agt-keys"
              ]
            },
            "description": "Actualiza a chave privada, pública e certificado AGT da empresa."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Companies"
    },
    {
      "name": "Credit Note Requests",
      "item": [
        {
          "name": "Solicitar nota de crédito",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/credit-note-requests",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "credit-note-requests"
              ]
            },
            "description": "Comprador solicita uma nota de crédito para uma fatura.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"invoiceId\": \"<invoiceId>\",\n  \"reason\": \"<reason>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Listar solicitações de nota de crédito",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/credit-note-requests",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "credit-note-requests"
              ]
            },
            "description": "Lista as solicitações de nota de crédito para a empresa, seja como comprador ou vendedor."
          },
          "response": []
        },
        {
          "name": "Aceitar solicitação de nota de crédito",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/credit-note-requests/{{client_id}}/accept",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "credit-note-requests",
                "{{client_id}}",
                "accept"
              ]
            },
            "description": "Vendedor aceita uma solicitação de nota de crédito."
          },
          "response": []
        },
        {
          "name": "Rejeitar solicitação de nota de crédito",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/credit-note-requests/{{client_id}}/reject",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "credit-note-requests",
                "{{client_id}}",
                "reject"
              ]
            },
            "description": "Vendedor rejeita uma solicitação de nota de crédito.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"rejectionReason\": \"<rejectionReason>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Aceitar nota de crédito emitida",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/credit-note-requests/accept-nc",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "credit-note-requests",
                "accept-nc"
              ]
            },
            "description": "Comprador aceita a nota de crédito emitida pelo vendedor.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"invoiceId\": \"<invoiceId>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Credit Note Requests"
    },
    {
      "name": "Customers",
      "item": [
        {
          "name": "Criar um novo cliente",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/customers",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "customers"
              ]
            },
            "description": "Cria um novo cliente e associa-o à empresa. Se o NIF já existir globalmente, reutiliza o registo (network effect).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"companyId\": \"<companyId>\",\n  \"name\": \"<name>\",\n  \"nif\": \"<nif>\",\n  \"tradeName\": \"<tradeName>\",\n  \"address\": \"<address>\",\n  \"city\": \"<city>\",\n  \"province\": \"<province>\",\n  \"country\": \"<country>\",\n  \"email\": \"<email>\",\n  \"phone\": \"<phone>\",\n  \"category\": \"<category>\",\n  \"notes\": \"<notes>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Listar clientes de uma empresa",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/customers/company/{{company_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "customers",
                "company",
                "{{company_id}}"
              ]
            },
            "description": "Lista todos os clientes activos de uma empresa."
          },
          "response": []
        },
        {
          "name": "Obter detalhes de um cliente",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/customers/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "customers",
                "{{client_id}}"
              ]
            },
            "description": "Retorna os detalhes de um cliente, incluindo estatísticas de facturação."
          },
          "response": []
        },
        {
          "name": "Actualizar um cliente",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/customers/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "customers",
                "{{client_id}}"
              ]
            },
            "description": "Actualiza os dados de um cliente.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"<name>\",\n  \"tradeName\": \"<tradeName>\",\n  \"address\": \"<address>\",\n  \"city\": \"<city>\",\n  \"province\": \"<province>\",\n  \"email\": \"<email>\",\n  \"phone\": \"<phone>\",\n  \"category\": \"<category>\",\n  \"notes\": \"<notes>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Arquivar um cliente",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/customers/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "customers",
                "{{client_id}}"
              ]
            },
            "description": "Desactiva o cliente para esta empresa (soft delete). Não apaga facturas existentes."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Customers"
    },
    {
      "name": "Dashboard",
      "item": [
        {
          "name": "Obter estatísticas do dashboard",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/dashboard/{{company_id}}/stats",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dashboard",
                "{{company_id}}",
                "stats"
              ]
            },
            "description": "Retorna estatísticas agregadas: total facturado, pendente, pago, estimativa de IVA, retenção na fonte, contagens por estado e tendência mensal dos últimos 12 meses."
          },
          "response": []
        },
        {
          "name": "Obter facturas recentes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/dashboard/{{company_id}}/recent-invoices",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dashboard",
                "{{company_id}}",
                "recent-invoices"
              ]
            },
            "description": "Retorna as últimas 5 facturas emitidas (não-rascunho)."
          },
          "response": []
        },
        {
          "name": "Facturas prestes a vencer",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/dashboard/{{company_id}}/upcoming-due",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dashboard",
                "{{company_id}}",
                "upcoming-due"
              ]
            },
            "description": "Retorna facturas com data de vencimento nos próximos N dias (padrão: 30). Ordenadas por urgência (mais próximas primeiro)."
          },
          "response": []
        },
        {
          "name": "Maiores clientes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/dashboard/{{company_id}}/top-clients",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "dashboard",
                "{{company_id}}",
                "top-clients"
              ]
            },
            "description": "Retorna os top 5 clientes por volume total faturado (excluindo rascunhos e cancelados)."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Dashboard"
    },
    {
      "name": "Delivery",
      "item": [
        {
          "name": "Entregar factura",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/delivery/invoice/{{invoice_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "delivery",
                "invoice",
                "{{invoice_id}}"
              ]
            },
            "description": "Entrega uma factura ao cliente. Chamado automaticamente após a emissão. Se o cliente estiver na rede Uwata, a entrega é instantânea."
          },
          "response": []
        },
        {
          "name": "Envio secundário",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/delivery/secondary",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "delivery",
                "secondary"
              ]
            },
            "description": "Envia uma cópia da factura por Email ou WhatsApp.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"invoiceId\": \"<invoiceId>\",\n  \"channel\": null,\n  \"recipient\": \"<recipient>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Enviar convite",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/delivery/invite",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "delivery",
                "invite"
              ]
            },
            "description": "Envia um convite para o cliente se registar na Uwata.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"customerId\": \"<customerId>\",\n  \"channel\": null,\n  \"personalMessage\": \"<personalMessage>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Verificar se cliente está na rede",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/delivery/network-check/{customerId}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "delivery",
                "network-check",
                "{customerId}"
              ]
            },
            "description": "Verifica se um cliente está na rede Uwata."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Delivery"
    },
    {
      "name": "Inbox",
      "item": [
        {
          "name": "Listar faturas emitidas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/inbox/emitidas",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "inbox",
                "emitidas"
              ]
            },
            "description": "Lista as faturas emitidas pela empresa, com opção de filtros."
          },
          "response": []
        },
        {
          "name": "Listar faturas recebidas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/inbox/recebidas",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "inbox",
                "recebidas"
              ]
            },
            "description": "Lista as faturas recebidas pela empresa, com opção de filtros."
          },
          "response": []
        },
        {
          "name": "Contar faturas recebidas não lidas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/inbox/recebidas/unread",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "inbox",
                "recebidas",
                "unread"
              ]
            },
            "description": "Retorna o número de faturas recebidas que ainda não foram lidas."
          },
          "response": []
        },
        {
          "name": "Marcar fatura como lida",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/inbox/recebidas/{{invoice_id}}/read",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "inbox",
                "recebidas",
                "{{invoice_id}}",
                "read"
              ]
            },
            "description": "Marca uma fatura recebida como lida."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Inbox"
    },
    {
      "name": "Invoice Series",
      "item": [
        {
          "name": "Listar séries de facturação de uma empresa",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoice-series/company/{{company_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoice-series",
                "company",
                "{{company_id}}"
              ]
            },
            "description": "Listar séries de facturação de uma empresa"
          },
          "response": []
        },
        {
          "name": "Criar nova série de facturação",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoice-series",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoice-series"
              ]
            },
            "description": "Criar nova série de facturação",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"companyId\": \"<companyId>\",\n  \"documentType\": \"<documentType>\",\n  \"prefix\": \"<prefix>\",\n  \"year\": 0\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Actualizar prefixo de uma série",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoice-series/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoice-series",
                "{{client_id}}"
              ]
            },
            "description": "Actualizar prefixo de uma série",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"prefix\": \"<prefix>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Desactivar uma série de facturação",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoice-series/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoice-series",
                "{{client_id}}"
              ]
            },
            "description": "Desactivar uma série de facturação"
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Invoice Series"
    },
    {
      "name": "Invoices",
      "item": [
        {
          "name": "Emitir nova factura",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices"
              ]
            },
            "description": "Cria e emite uma nova factura (FT, FR, NC, etc.).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"companyId\": \"<companyId>\",\n  \"customerId\": \"<customerId>\",\n  \"documentType\": \"<documentType>\",\n  \"issueDate\": \"<issueDate>\",\n  \"dueDate\": \"<dueDate>\",\n  \"items\": [],\n  \"serviceCategoryOverride\": \"<serviceCategoryOverride>\",\n  \"vatExemptionCode\": \"<vatExemptionCode>\",\n  \"vatExemptionReason\": \"<vatExemptionReason>\",\n  \"notes\": \"<notes>\",\n  \"creationMethod\": null,\n  \"isOfflineCreated\": false,\n  \"originalInvoiceId\": \"<originalInvoiceId>\",\n  \"cancellationReason\": \"<cancellationReason>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Listar facturas da empresa",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/company/{{company_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                "company",
                "{{company_id}}"
              ]
            },
            "description": "Lista facturas de uma empresa com paginação e filtros."
          },
          "response": []
        },
        {
          "name": "Detalhes da factura",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                "{{client_id}}"
              ]
            },
            "description": "Obtém os detalhes completos de uma factura específica."
          },
          "response": []
        },
        {
          "name": "Emitir Nota de Crédito",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{{client_id}}/credit-note",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                "{{client_id}}",
                "credit-note"
              ]
            },
            "description": "Cancela uma FT ou FR e emite automaticamente a respectiva Nota de Crédito (NC). Requer confirmação explícita das regras AGT.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"<reason>\",\n  \"reasonDescription\": \"<reasonDescription>\",\n  \"agtRulesConfirmed\": false,\n  \"clientEmail\": \"<clientEmail>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Converter Proforma em FT ou FR",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{{client_id}}/convert",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                "{{client_id}}",
                "convert"
              ]
            },
            "description": "Converte uma Proforma em Factura (FT) ou Factura-Recibo (FR). O targetType define o tipo destino (padrão: FT).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"targetType\": null,\n  \"dueDate\": \"<dueDate>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Invoices"
    },
    {
      "name": "Items",
      "item": [
        {
          "name": "Criar item no catálogo",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/items",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "items"
              ]
            },
            "description": "Criar item no catálogo",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"companyId\": \"<companyId>\",\n  \"name\": \"<name>\",\n  \"description\": \"<description>\",\n  \"nature\": \"<nature>\",\n  \"unitPriceCents\": 0,\n  \"vatRate\": 0,\n  \"unit\": \"<unit>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Listar itens do catálogo de uma empresa",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/items/company/{{company_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "items",
                "company",
                "{{company_id}}"
              ]
            },
            "description": "Listar itens do catálogo de uma empresa"
          },
          "response": []
        },
        {
          "name": "Actualizar item do catálogo",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/items/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "items",
                "{{client_id}}"
              ]
            },
            "description": "Actualizar item do catálogo",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"<name>\",\n  \"description\": \"<description>\",\n  \"nature\": \"<nature>\",\n  \"unitPriceCents\": 0,\n  \"vatRate\": 0,\n  \"unit\": \"<unit>\",\n  \"isActive\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Arquivar item do catálogo (soft delete)",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/items/{{client_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "items",
                "{{client_id}}"
              ]
            },
            "description": "Arquivar item do catálogo (soft delete)"
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Items"
    },
    {
      "name": "Members",
      "item": [
        {
          "name": "Convidar membros",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/{{company_id}}/members/invite",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                "{{company_id}}",
                "members",
                "invite"
              ]
            },
            "description": "Convida membros para a empresa por email. Verifica limites do plano.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"emails\": [],\n  \"role\": \"<role>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Listar membros",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/{{company_id}}/members",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                "{{company_id}}",
                "members"
              ]
            },
            "description": "Lista todos os membros activos da empresa com informação de limites."
          },
          "response": []
        },
        {
          "name": "Alterar role de membro",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/{{company_id}}/members/{memberId}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                "{{company_id}}",
                "members",
                "{memberId}"
              ]
            },
            "description": "Altera o role de um membro. Apenas o OWNER pode alterar.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"role\": \"<role>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remover membro",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/companies/{{company_id}}/members/{memberId}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "companies",
                "{{company_id}}",
                "members",
                "{memberId}"
              ]
            },
            "description": "Remove um membro da empresa. OWNER e ADMIN podem remover."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Members"
    },
    {
      "name": "Notifications",
      "item": [
        {
          "name": "Listar notificações da empresa",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/notifications",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "notifications"
              ]
            },
            "description": "GET /notifications\nLista notificações da empresa activa do utilizador autenticado.\nPor defeito, mostra apenas os últimos 30 dias (15 por página)."
          },
          "response": []
        },
        {
          "name": "Contar notificações não lidas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/notifications/unread",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "notifications",
                "unread"
              ]
            },
            "description": "GET /notifications/unread\nConta notificações não-lidas (endpoint leve para polling de badges)."
          },
          "response": []
        },
        {
          "name": "Marcar todas as notificações como lidas",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/notifications/read-all",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "notifications",
                "read-all"
              ]
            },
            "description": "PATCH /notifications/read-all\nMarca todas as notificações da empresa como lidas.\nNOTA: deve vir antes de /:id/read para evitar conflito de rotas."
          },
          "response": []
        },
        {
          "name": "Marcar notificação como lida",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/notifications/{{client_id}}/read",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "notifications",
                "{{client_id}}",
                "read"
              ]
            },
            "description": "PATCH /notifications/:id/read\nMarca uma notificação como lida."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Notifications"
    },
    {
      "name": "Other",
      "item": [
        {
          "name": "GET /api/v1/billing/plans",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/billing/plans",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "billing",
                "plans"
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "GET /api/v1/billing/subscription/{companyId}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/billing/subscription/{{company_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "billing",
                "subscription",
                "{{company_id}}"
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "POST /api/v1/billing/subscribe",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/billing/subscribe",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "billing",
                "subscribe"
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "POST /api/v1/billing/webhook/proxypay",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/billing/webhook/proxypay",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "billing",
                "webhook",
                "proxypay"
              ]
            },
            "description": ""
          },
          "response": []
        },
        {
          "name": "",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/saft/export",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "saft",
                "export"
              ]
            },
            "description": "Gera o ficheiro SAF-T (AO) para o período indicado e devolve para download.\n\nQuery params:\n  companyId    — ID da empresa\n  periodStart  — Data de início (YYYY-MM-DD)\n  periodEnd    — Data de fim (YYYY-MM-DD)"
          },
          "response": []
        },
        {
          "name": "",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/agt/transmit/{{invoice_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "agt",
                "transmit",
                "{{invoice_id}}"
              ]
            },
            "description": "Transmitir uma factura específica"
          },
          "response": []
        },
        {
          "name": "",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/agt/transmit-batch",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "agt",
                "transmit-batch"
              ]
            },
            "description": "Transmitir todas as facturas PENDING da empresa"
          },
          "response": []
        },
        {
          "name": "",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/agt/status/{{invoice_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "agt",
                "status",
                "{{invoice_id}}"
              ]
            },
            "description": "Verificar estado de transmissão de uma factura"
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo Other"
    },
    {
      "name": "PDF",
      "item": [
        {
          "name": "Baixar fatura em PDF",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{{client_id}}/pdf",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                "{{client_id}}",
                "pdf"
              ]
            },
            "description": "Realiza o download da fatura em formato PDF."
          },
          "response": []
        },
        {
          "name": "Pré-visualizar fatura em PDF",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/invoices/{{client_id}}/pdf/preview",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "invoices",
                "{{client_id}}",
                "pdf",
                "preview"
              ]
            },
            "description": "Retorna o PDF da fatura para exibição inline no navegador."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo PDF"
    },
    {
      "name": "ProxyPay",
      "item": [
        {
          "name": "Gerar referência de pagamento",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/proxypay/references",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "proxypay",
                "references"
              ]
            },
            "description": "Gera uma nova referência de pagamento Multicaixa para uma factura.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"invoiceId\": \"<invoiceId>\",\n  \"expiresAt\": \"<expiresAt>\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Receber notificação de pagamento (Webhook)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/proxypay/webhook",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "proxypay",
                "webhook"
              ]
            },
            "description": "Endpoint para receber notificações de pagamento da ProxyPay. Não requer autenticação JWT, mas valida a assinatura HMAC da ProxyPay.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": 0,\n  \"amount\": \"<amount>\",\n  \"datetime\": \"<datetime>\",\n  \"reference_id\": 0,\n  \"entity_id\": 0,\n  \"fee\": \"<fee>\",\n  \"transaction_id\": 0,\n  \"period_id\": 0,\n  \"period_start_datetime\": \"<period_start_datetime>\",\n  \"period_end_datetime\": \"<period_end_datetime>\",\n  \"terminal_type\": \"<terminal_type>\",\n  \"terminal_id\": \"<terminal_id>\",\n  \"terminal_location\": \"<terminal_location>\",\n  \"terminal_transaction_id\": 0,\n  \"terminal_period_id\": 0,\n  \"product_id\": 0,\n  \"parameter_id\": 0,\n  \"custom_fields\": null\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Consultar referência de pagamento de uma factura",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Company-Id",
                "value": "{{company_id}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/proxypay/references/{{invoice_id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "proxypay",
                "references",
                "{{invoice_id}}"
              ]
            },
            "description": "Retorna a referência de pagamento Multicaixa activa (se existir) para uma determinada factura."
          },
          "response": []
        }
      ],
      "description": "Endpoints do grupo ProxyPay"
    }
  ]
}