diff --git a/.agents/skills/review-platform-api-contract/SKILL.md b/.agents/skills/review-platform-api-contract/SKILL.md new file mode 100644 index 000000000..2b666d569 --- /dev/null +++ b/.agents/skills/review-platform-api-contract/SKILL.md @@ -0,0 +1,76 @@ +--- +name: review-platform-api-contract +description: Review Fyle Platform API contract pull requests across runtime code, OpenAPI source and bundles, generated TypeScript, and consumers. Use for changes to endpoints, request or response schemas, requiredness, nullability, enums, or compatibility in fyle-platform-docs, fyle-platform-api, or fyle-platform-types. Produce evidence-backed findings and do not publish review comments unless explicitly asked. +--- + +# Review Platform API Contracts + +Compare the proposed API contract change with runtime behavior, OpenAPI, and downstream types. Read [references/contract-chain.md](references/contract-chain.md) for repository-specific paths and commands. + +## 1. Fix the review scope + +- Resolve the PR base and head to immutable commits. Resolve the runtime revision separately: prefer a linked API PR or commit; otherwise use the API default-branch commit only as evidence of current behavior. Never use a sibling checkout unless its commit matches the recorded revision. +- Label each repository commit as proposed, current, or historical evidence. Do not use current behavior to prove what an old or closed PR did. +- Read the repository-local guidance files that exist, such as `AGENTS.md` or `CLAUDE.md`, and inspect each working-tree status. +- Preserve local changes. Use GitHub, `git show`, temporary copies, or a temporary worktree when a sibling repository is dirty. +- Inspect changed files, checks, reviews, and existing comments so findings are scoped and not duplicated. +- For docs-backed changes, run `/scripts/contract_diff_inventory.py` with the PR base and head. Use its source-file, risk, role, and bulk-mode counts as review denominators. +- Triage changed source lines first. Prioritize `$ref`, requiredness, nullability, enums, shared schemas, and request/response shape changes; trace high-risk candidates through the full chain before expanding the review. + +If a required repository is unavailable, continue only with supported conclusions and state the evidence gap. + +## 2. Review source before generated output + +- Treat `fyle-platform-docs/src/**` as source and `reference/*.yaml` as generated output. +- Map generated changes back to the exact source schema or path and attach findings there. +- Read the affected root document's OpenAPI version. +- Lint and rebuild every role reported by the inventory. A change under `src/components/**` requires every discoverable role root; a role-local change requires that role. + +## 3. Prove runtime behavior + +Trace each high-risk changed field from the endpoint through the exact runtime path. + +Read runtime files from the selected immutable commit with `git show` or an isolated worktree. If no revision is linked strongly enough to support the claim, report the gap instead of treating an unrelated current checkout as proof. + +- For requests, inspect the loaded Marshmallow schema, validation, defaults, `post_load`, action logic, and request/error fixtures. +- For responses, inspect the handler's dump schema, serialization hooks, the object being dumped, models, current database views and constraints, relevant migrations, and response fixtures. +- For enums, compare OpenAPI with the runtime enum, validators, storage representation, fixtures, migrations, and history for removed values. + +Use these contract rules: + +- Marshmallow `required` primarily controls loading; it does not prove response-key presence. +- OpenAPI object-level `required` means the key is present. `nullable` means a present key may be `null`. +- Omitted and present-with-`null` are different contracts. +- In OpenAPI 3.0, schema keywords beside `$ref` do not extend the referenced schema. Use `allOf` only after runtime evidence proves the added constraint is correct. +- When input and output behavior differ, prefer separate request and response schemas over weakening the response contract. + +Do not infer runtime behavior from the OpenAPI diff or a Marshmallow field flag alone. + +## 4. Check generated types and consumers + +- Compare base and proposed bundles in isolated directories in `fyle-platform-types`. +- Run the version classifier and generate representative before/after TypeScript when the contract shape changes. +- If dependencies are unavailable, compare the specs and generator configuration only. Generated output is not committed in `fyle-platform-types`; mark TypeScript shape and semver as unverified instead of installing into a sibling repository. +- Search identifiable consumers for affected imports, enum members, request arguments, optional fields, and null handling. +- Classify runtime compatibility, documentation accuracy, generated-source compatibility, and semver impact separately. + +Do not call a change runtime-breaking only because a generated type breaks, or call it documentation-only when generated consumers need a migration. + +## 5. Validate and report + +Run the smallest relevant checks from the repository map. Report failures and skipped checks without hiding them. + +When the inventory selects bulk mode, account for the whole diff: + +- Disposition every changed source file as manually reviewed or covered by a named deterministic check. +- Triage every risk-marker line and trace every resulting high-risk candidate; group mechanical edits only after proving the same rule covers every member. +- Report `reviewed/total` for source files, risk-marker lines, high-risk candidates, bundle roles, generated roles, and known consumer symbols. Sampling can support a finding, but cannot support a claim of complete review. + +Return findings in severity order. Each finding must include: + +1. The exact changed source line; for docs changes, prefer `src/**` over `reference/**`. +2. The concrete contract mismatch and user or SDK impact. +3. Concise runtime and generated-type evidence. +4. A specific requested change and, when useful, a proposed inline comment. + +Finish with the reviewed commits, checks run or skipped, evidence gaps, and publication status. Keep comments as proposals unless the user explicitly authorizes posting them. diff --git a/.agents/skills/review-platform-api-contract/agents/openai.yaml b/.agents/skills/review-platform-api-contract/agents/openai.yaml new file mode 100644 index 000000000..d99f5a2dd --- /dev/null +++ b/.agents/skills/review-platform-api-contract/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "Review Platform API Contract" + short_description: "Review API contracts across runtime and types" + default_prompt: "Use $review-platform-api-contract to review this API contract PR across runtime, OpenAPI source, generated types, and consumers." diff --git a/.agents/skills/review-platform-api-contract/references/contract-chain.md b/.agents/skills/review-platform-api-contract/references/contract-chain.md new file mode 100644 index 000000000..d3230dc8c --- /dev/null +++ b/.agents/skills/review-platform-api-contract/references/contract-chain.md @@ -0,0 +1,121 @@ +# Platform API contract chain + +The repositories normally live beside one another: + +| Repository | Contract role | +| --- | --- | +| `fyle-platform-api` | Runtime handlers, schemas, models, database views, migrations, and fixtures | +| `fyle-platform-docs` | OpenAPI source in `src/` and generated bundles in `reference/` | +| `fyle-platform-types` | Synced bundles, generated TypeScript, and semver classification | +| `fyle-app` | Known direct consumer of `@fylein/types`; do not assume it is the only consumer | + +Resolve default branches and commits at review time. The contract flow is: + +```text +fyle-platform-api runtime + -> fyle-platform-docs/src + -> fyle-platform-docs/reference + -> fyle-platform-types/specs + -> @fylein/types + -> consumers +``` + +## Record repository state + +```bash +git status --short --branch +git symbolic-ref --short refs/remotes/origin/HEAD +git log -1 --format='%H %cI %s' +gh pr view --json baseRefOid,headRefOid,state,url +``` + +The PR base branch may advance after the PR opens. Resolve both PR refs, then use their merge base for the reviewed diff. For runtime evidence, use a linked `fyle-platform-api` PR or commit when one exists. Otherwise, an exact default-branch commit can prove only current behavior. A checked-out branch, similar timestamp, or current file is not evidence for a historical PR unless its commit is the selected revision. + +Record the evidence role beside every commit: proposed change, current behavior, or historical context. Read files with `git show :` or from an isolated worktree so paths from different revisions are not mixed. + +Do not switch, pull, install into, or generate inside a dirty sibling. Use read-only evidence or an isolated worktree instead. + +## Review and validate docs + +`src//openapi.yaml` declares the document version, tags, security, and path references. Endpoint definitions live in `src//paths/`; shared schemas live in `src/components/schemas/`. Filenames use `@` for URL separators. + +Inventory a docs diff before tracing it: + +```bash +python3 /scripts/contract_diff_inventory.py \ + --repo --base --head +``` + +The script resolves immutable commits, computes the merge base, counts changed source files and risk-marker lines, discovers role roots from `src/*/openapi.yaml`, and selects bulk mode for more than 10 source files or more than 3 directly changed roles. Use `--format json` when file-level details are needed. + +`reference/.yaml` is generated. Read the pinned Redocly version from `.github/workflows/bundler.yml` at the reviewed revision and verify its bundle steps cover every discovered role root. Lint and bundle every role reported by the inventory: + +```bash +openapi lint src//openapi.yaml +openapi bundle -o /tmp/.yaml src//openapi.yaml +``` + +Compare temporary base and head bundles with their corresponding committed `reference/.yaml` files, then compare base with head. A shared `src/components/**` change requires all role roots because shared-schema fan-out is not reliably visible from changed paths alone. + +## Trace runtime behavior + +Start from the route and inspect only the evidence needed for the changed field: + +- `api//.py` or the relevant blueprint and view. +- `api//schema.py` and inherited `core/schema/**` fields. +- The action class and model validation for writes. +- `db/models/**` column definitions. +- Current `db-migrations/views/**` plus migrations that changed the field or view. +- `api/tests/**/input.yaml` and `expected_output.yaml` for successful and validation-error cases. + +Use history when removed enum values or legacy storage are relevant: + +```bash +git log -p -G '' --all -- +``` + +Run the narrowest affected test group or test case using the commands in `fyle-platform-api/CLAUDE.md` when runtime verification is needed. + +## Compare generated types + +Read `package.json` for the required Node and pnpm versions. The useful entry points are: + +```bash +pnpm test +OLD_SPECS_DIR= NEW_SPECS_DIR= pnpm run version:check +OPENAPI_SPECS_DIR= OPENAPI_OUTPUT_DIR= pnpm exec openapi-ts +``` + +Use temporary base/head spec and output directories. `pnpm run build` syncs local docs into the types worktree, so run it only in an isolated worktree. + +`dist/` and `.generated/` are ignored rather than committed. If generation dependencies cannot run, compare the input specs and generator configuration, state that generated TypeScript and semver are unverified, and stop short of claiming full-chain validation. + +The classifier's highest result wins: + +- `major`: `oasdiff breaking` reports a breaking OpenAPI change or a role disappears. +- `minor`: generated structure changes without an OpenAPI breaking result, or a role appears. +- `patch`: only generated documentation changes. +- `none`: no generated or documentation change. + +## Account for broad changes + +For bulk mode, keep a coverage manifest with these denominators: + +- changed `src/**` files reviewed; +- risk-marker lines triaged and resulting candidates traced to runtime evidence; +- bundle roles linted and regenerated; +- generated roles compared when shape changes; +- affected symbols checked in every known available consumer. + +Report each as `reviewed/total` and name the deterministic check used for grouped mechanical edits. Do not describe a sampled review as exhaustive; list any uncovered files, roles, or consumers as evidence gaps. + +## Find consumers + +`TYPES_CONSUMER_REPOS` is a GitHub repository variable and is not enumerated in source. Search available sibling repositories instead: + +```bash +rg -l '"@fylein/types"\s*:' .. -g 'package.json' -g '!**/node_modules/**' -g '!**/.pnpm-store/**' +rg '' ../ -g '*.ts' -g '*.tsx' -g '!**/node_modules/**' +``` + +Inspect only consumers that use affected generated symbols. State that the search is incomplete when private or unavailable consumers may exist. diff --git a/.agents/skills/review-platform-api-contract/scripts/contract_diff_inventory.py b/.agents/skills/review-platform-api-contract/scripts/contract_diff_inventory.py new file mode 100644 index 000000000..b7493ffde --- /dev/null +++ b/.agents/skills/review-platform-api-contract/scripts/contract_diff_inventory.py @@ -0,0 +1,278 @@ +#!/usr/bin/env python3 +"""Inventory an OpenAPI source diff without modifying the repository.""" + +from __future__ import annotations + +import argparse +import json +import re +import subprocess +import sys +from dataclasses import asdict, dataclass +from pathlib import Path + + +BULK_SOURCE_FILE_LIMIT = 10 +BULK_ROLE_LIMIT = 3 +ROLE_ROOT = re.compile(r"^src/([^/]+)/openapi\.yaml$") +RISK_MARKERS = { + "ref": re.compile(r"\$ref\s*:"), + "required": re.compile(r"\brequired\s*:"), + "nullable": re.compile(r"\bnullable\s*:"), + "enum": re.compile(r"\benum\s*:"), + "composition": re.compile(r"\b(?:allOf|anyOf|oneOf)\s*:"), + "shape": re.compile(r"\b(?:type|properties|items|additionalProperties)\s*:"), + "operation": re.compile(r"\b(?:requestBody|responses|schema)\s*:"), + "list_item": re.compile(r"^\s*-\s+\S"), +} + + +@dataclass(frozen=True) +class SourceChange: + status: str + old_path: str | None + new_path: str | None + + +@dataclass(frozen=True) +class RiskLine: + path: str + side: str + line: int + markers: tuple[str, ...] + text: str + + +def run_git(repo: Path, *args: str, binary: bool = False) -> str | bytes: + result = subprocess.run( + ["git", "-C", str(repo), *args], + capture_output=True, + text=not binary, + check=False, + ) + if result.returncode != 0: + stderr = result.stderr.decode() if binary else result.stderr + raise RuntimeError(stderr.strip() or f"git {' '.join(args)} failed") + return result.stdout + + +def resolve_commit(repo: Path, ref: str) -> str: + output = run_git(repo, "rev-parse", "--verify", f"{ref}^{{commit}}") + assert isinstance(output, str) + return output.strip() + + +def parse_source_changes(repo: Path, base: str, head: str) -> list[SourceChange]: + output = run_git( + repo, + "diff", + "--name-status", + "-z", + "--find-renames", + base, + head, + "--", + "src", + binary=True, + ) + assert isinstance(output, bytes) + tokens = output.decode("utf-8", errors="surrogateescape").split("\0") + if tokens and not tokens[-1]: + tokens.pop() + + changes: list[SourceChange] = [] + index = 0 + while index < len(tokens): + status = tokens[index] + index += 1 + if status.startswith(("R", "C")): + old_path, new_path = tokens[index : index + 2] + index += 2 + else: + path = tokens[index] + index += 1 + old_path = None if status == "A" else path + new_path = None if status == "D" else path + changes.append(SourceChange(status, old_path, new_path)) + return changes + + +def role_roots(repo: Path, commit: str) -> set[str]: + output = run_git(repo, "ls-tree", "-r", "--name-only", commit, "--", "src") + assert isinstance(output, str) + roles = set() + for path in output.splitlines(): + match = ROLE_ROOT.match(path) + if match: + roles.add(match.group(1)) + return roles + + +def changed_paths(change: SourceChange) -> tuple[str, ...]: + return tuple(path for path in (change.old_path, change.new_path) if path) + + +def parse_hunk_start(header: str) -> tuple[int, int]: + match = re.match(r"@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@", header) + if not match: + raise RuntimeError(f"cannot parse diff hunk: {header}") + return int(match.group(1)), int(match.group(2)) + + +def risk_lines(repo: Path, base: str, head: str) -> list[RiskLine]: + output = run_git( + repo, + "diff", + "--unified=0", + "--no-color", + "--no-ext-diff", + base, + head, + "--", + "src", + ) + assert isinstance(output, str) + + old_path: str | None = None + new_path: str | None = None + old_line = 0 + new_line = 0 + hits: list[RiskLine] = [] + for raw_line in output.splitlines(): + if raw_line.startswith("diff --git "): + old_path = None + new_path = None + continue + if raw_line.startswith("--- "): + path = raw_line[4:] + old_path = path[2:] if path.startswith("a/") else None + continue + if raw_line.startswith("+++ "): + path = raw_line[4:] + new_path = path[2:] if path.startswith("b/") else None + continue + if raw_line.startswith("@@ "): + old_line, new_line = parse_hunk_start(raw_line) + continue + if raw_line.startswith("index "): + continue + + side: str | None = None + line_number = 0 + content = "" + if raw_line.startswith("+"): + side, line_number, content = "added", new_line, raw_line[1:] + new_line += 1 + elif raw_line.startswith("-"): + side, line_number, content = "removed", old_line, raw_line[1:] + old_line += 1 + elif raw_line.startswith(" "): + old_line += 1 + new_line += 1 + + path = new_path if side == "added" else old_path + if side and path: + markers = tuple( + name for name, pattern in RISK_MARKERS.items() if pattern.search(content) + ) + if markers: + hits.append(RiskLine(path, side, line_number, markers, content.strip())) + return hits + + +def build_inventory(repo: Path, base_ref: str, head_ref: str) -> dict[str, object]: + base_commit = resolve_commit(repo, base_ref) + head_commit = resolve_commit(repo, head_ref) + merge_base = run_git(repo, "merge-base", base_commit, head_commit) + assert isinstance(merge_base, str) + merge_base = merge_base.strip() + + changes = parse_source_changes(repo, merge_base, head_commit) + roles = role_roots(repo, merge_base) | role_roots(repo, head_commit) + shared_changes = [ + change + for change in changes + if any(path.startswith("src/components/") for path in changed_paths(change)) + ] + direct_roles = sorted( + role + for role in roles + if any( + path.startswith(f"src/{role}/") + for change in changes + for path in changed_paths(change) + ) + ) + bundle_roles = sorted(roles if shared_changes else direct_roles) + hits = risk_lines(repo, merge_base, head_commit) + marker_counts = { + marker: sum(marker in hit.markers for hit in hits) for marker in RISK_MARKERS + } + marker_counts = {name: count for name, count in marker_counts.items() if count} + bulk_mode = len(changes) > BULK_SOURCE_FILE_LIMIT or len(direct_roles) > BULK_ROLE_LIMIT + + return { + "repository": str(repo), + "base_ref": base_ref, + "base_commit": base_commit, + "head_ref": head_ref, + "head_commit": head_commit, + "merge_base": merge_base, + "source_file_count": len(changes), + "shared_component_file_count": len(shared_changes), + "direct_roles": direct_roles, + "bundle_roles": bundle_roles, + "risk_marker_line_count": len(hits), + "risk_marker_counts": marker_counts, + "bulk_mode": bulk_mode, + "bulk_thresholds": { + "source_files_greater_than": BULK_SOURCE_FILE_LIMIT, + "direct_roles_greater_than": BULK_ROLE_LIMIT, + }, + "source_changes": [asdict(change) for change in changes], + "risk_lines": [asdict(hit) for hit in hits], + } + + +def print_summary(inventory: dict[str, object]) -> None: + print(f"base_commit: {inventory['base_commit']}") + print(f"head_commit: {inventory['head_commit']}") + print(f"merge_base: {inventory['merge_base']}") + print(f"source_files: {inventory['source_file_count']}") + print(f"shared_component_files: {inventory['shared_component_file_count']}") + print(f"direct_roles: {', '.join(inventory['direct_roles']) or '-'}") + print(f"bundle_roles: {', '.join(inventory['bundle_roles']) or '-'}") + print(f"risk_marker_lines: {inventory['risk_marker_line_count']}") + counts = inventory["risk_marker_counts"] + assert isinstance(counts, dict) + formatted_counts = ", ".join(f"{name}={count}" for name, count in counts.items()) + print(f"risk_markers: {formatted_counts or '-'}") + print(f"bulk_mode: {'yes' if inventory['bulk_mode'] else 'no'}") + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--repo", default=".", help="fyle-platform-docs checkout") + parser.add_argument("--base", required=True, help="PR base ref or commit") + parser.add_argument("--head", required=True, help="PR head ref or commit") + parser.add_argument("--format", choices=("summary", "json"), default="summary") + args = parser.parse_args() + + try: + repo_output = run_git(Path(args.repo).resolve(), "rev-parse", "--show-toplevel") + assert isinstance(repo_output, str) + repo = Path(repo_output.strip()) + inventory = build_inventory(repo, args.base, args.head) + except RuntimeError as error: + print(f"error: {error}", file=sys.stderr) + return 2 + + if args.format == "json": + print(json.dumps(inventory, indent=2)) + else: + print_summary(inventory) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/.github/workflows/bundler.yml b/.github/workflows/bundler.yml index e71212efd..d7f0cb626 100644 --- a/.github/workflows/bundler.yml +++ b/.github/workflows/bundler.yml @@ -28,7 +28,7 @@ jobs: node-version: 22.x - name: Install dependencies - run: npm install -g @redocly/cli@2.0.5 + run: npm install -g @redocly/cli@2.19.0 - name: Update authorization docs run: openapi bundle -o reference/authorization.yaml src/authorization/openapi.yaml diff --git a/.github/workflows/notify-types-repo.yml b/.github/workflows/notify-types-repo.yml new file mode 100644 index 000000000..31d734ff1 --- /dev/null +++ b/.github/workflows/notify-types-repo.yml @@ -0,0 +1,36 @@ +name: Notify types repo on spec change + +# Fires after the bundler commits regenerated specs to reference/. +# The bundler commits via a PAT, so its push re-triggers this workflow, +# and the reference/** path filter ensures we only notify on real changes. +on: + push: + branches: + - main + paths: + - 'reference/**' + +permissions: + contents: read + +jobs: + notify: + name: Dispatch to fyle-platform-types + runs-on: ubuntu-latest + steps: + - name: Generate token for fyle-platform-types + id: app-token + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.GH_TYPES_DISPATCH_APP_ID }} + private-key: ${{ secrets.GH_TYPES_DISPATCH_APP_PRIVATE_KEY }} + owner: fylein + repositories: fyle-platform-types + + - name: Notify fyle-platform-types of spec change + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ steps.app-token.outputs.token }} + repository: fylein/fyle-platform-types + event-type: specs-updated + client-payload: '{"sha": "${{ github.sha }}", "ref": "${{ github.ref }}"}' diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..36034e405 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,108 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Overview + +`fyle-platform-docs` is the OpenAPI documentation repository for the Sage Expense Management Platform APIs, published at [docs.fylehq.com](https://docs.fylehq.com). It uses Redocly CLI to lint and bundle modular OpenAPI 3.0 specs, and Stoplight Prism for mock servers. + +## Prerequisites + +- Node.js >= v14.15.3 +- Redocly CLI: `npm install -g @redocly/openapi-cli` + +## Common Commands + +### Linting + +Lint any role's spec before committing changes: + +```bash +openapi lint src/admin/openapi.yaml +openapi lint src/spender/openapi.yaml +openapi lint src/approver/openapi.yaml +openapi lint src/authorization/openapi.yaml +openapi lint src/hod/openapi.yaml +openapi lint src/hop/openapi.yaml +openapi lint src/common/openapi.yaml +openapi lint src/accountant/openapi.yaml +openapi lint src/super_admin/openapi.yaml +``` + +### Bundling + +Bundle a role's modular spec into a single reference file (required before the mock server picks up changes): + +```bash +openapi bundle -o reference/admin.yaml src/admin/openapi.yaml +openapi bundle -o reference/spender.yaml src/spender/openapi.yaml +# etc. — pattern: openapi bundle -o reference/.yaml src//openapi.yaml +``` + +Bundling also runs automatically via GitHub Actions on push/PR to `main`. + +### Preview Docs + +```bash +openapi preview-docs src/admin/openapi.yaml +``` + +### Mock Server + +The mock server reads from the bundled `reference/` files, so bundle first if you've made changes: + +```bash +docker-compose up +``` + +| Role | Port | +|---|---| +| Admin | 4011 | +| Spender | 4012 | +| Approver | 4013 | +| Common / Accountant / Super Admin | 4014 | +| Manager | 4015 | + +## Deployment + +After a feature PR is merged to `main`, deploy to production by merging `main` into the `v1` branch: + +```bash +git checkout main && git pull origin main +git checkout v1 && git pull origin v1 +git merge main +git push origin v1 +``` + +## Architecture + +### Source specs (`src/`) + +Each user role has its own OpenAPI module: + +``` +src/ +├── / +│ ├── openapi.yaml # Root spec — declares servers, tags, security, and $ref paths +│ └── paths/ # One YAML file per endpoint, named [@].yaml +├── components/ +│ ├── parameters/ # Shared query/header parameters +│ └── schemas/ # Shared request/response schemas +``` + +Roles: `admin`, `spender`, `approver`, `authorization`, `common`, `accountant`, `hod`, `hop`, `owner`, `manager`, `super_admin`. + +Path files use `@` as a URL separator in filenames (e.g., `admin@expenses@bulk.yaml` → `POST /admin/expenses/bulk`). + +### Bundled specs (`reference/`) + +The `reference/` directory contains fully-resolved, single-file versions of each role's spec, generated by `openapi bundle`. These are what the mock server and docs platform consume. Do not edit these files directly — they are generated. + +### Docs content (`docs/`) + +Markdown files for conceptual documentation (auth flows, data API guide, event subscriptions, cluster/region routing, error reference). Structured via `toc.json`. + +## PR Requirements + +- Title must match: `^(fix|feat|test|chore|refactor|build):` (case-insensitive) +- Description must contain a ClickUp link (`app.clickup.com`) diff --git a/docs/concepts/oauth2-application.md b/docs/concepts/oauth2-application.md index 86872977c..f62e8f46a 100644 --- a/docs/concepts/oauth2-application.md +++ b/docs/concepts/oauth2-application.md @@ -35,7 +35,7 @@ You can add the redirect URIs that you want to allow in the OAuth 2.0 flows. Aft We currently support the "Authorization Code" flow and "Refresh Token Flow" of OAuth 2.0. If you want a primer on these flows, head to this great [blogpost](https://darutk.medium.com/diagrams-and-movies-of-all-the-oauth-2-0-flows-194f3c3ade85), but come back soon! We plan on adding support for PKCE Authorization request in the near future. To authorize the app: -* use the following URL: `https://app.fylehq.com/app/developers/#/oauth/authorize?client_id=&redirect_uri=` +* use the following URL: `https://app.fylehq.com/app/developers/oauth/authorize?client_id=&redirect_uri=` * replace the `` with your `client_id` * replace the `` with your redirect URI * if no redirect URI is setup for your app, you may remove the following from the above URL `&redirect_uri=` diff --git a/reference/accountant.yaml b/reference/accountant.yaml index 55a0ed1ca..4d6485071 100644 --- a/reference/accountant.yaml +++ b/reference/accountant.yaml @@ -30,6 +30,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -117,7 +121,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions @@ -186,6 +190,12 @@ components: file_generate_urls_action_out: type: object additionalProperties: false + required: + - id + - name + - content_type + - download_url + - upload_url properties: id: $ref: '#/components/schemas/id_string' diff --git a/reference/admin.yaml b/reference/admin.yaml index 4bd6552df..5326d394e 100644 --- a/reference/admin.yaml +++ b/reference/admin.yaml @@ -130,6 +130,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -178,6 +182,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_approver_project_out' @@ -377,6 +383,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -431,6 +441,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_cost_center_out' @@ -513,6 +525,107 @@ paths: application/json: schema: $ref: '#/components/schemas/403' + /admin/cost_centers/delete/bulk: + post: + tags: + - Cost Centers + summary: Deletes cost centers + description: | + Deletes unused cost centers. If any of the cost center in input is used in other resources then validation error is raised. + operationId: cost_centers_delete_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/cost_center_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + nullable: true + example: | + Can not delete cost center(s) used in other resources like expense, expense policy, expense rules, budgets, dependent fields. + data: + type: object + example: null + error: + type: string + example: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + /admin/cost_centers/delete_summary/bulk: + post: + tags: + - Cost Centers + summary: Create delete summary for cost centers + description: | + Delete summary tells that how many cost centers could be deleted from given cost centers, it also + returns cost centers that could be deleted. + operationId: cost_centers_delete_summary_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/cost_center_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/cost_center_delete_summary_out' + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' /admin/categories: get: tags: @@ -529,6 +642,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -577,6 +694,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_approver_category_out' @@ -777,6 +896,9 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count properties: count: $ref: '#/components/schemas/count' @@ -811,6 +933,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -855,6 +981,8 @@ paths: application/json: schema: type: object + required: + - data properties: url: type: string @@ -884,6 +1012,69 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /admin/expense_fields/reorder: + post: + tags: + - Expenses + summary: Reorder custom expense fields + description: | + Reorders all enabled, non-dependent custom expense fields for the + organization. Every eligible expense field must be included exactly once. + The order of the request items determines the `display_order`, starting from 1. + operationId: expense_fields_reorder + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: The complete ordered list of eligible expense field IDs. + minItems: 1 + uniqueItems: true + items: + $ref: '#/components/schemas/expense_field_reorder_in' + responses: + '200': + description: Expense fields reordered successfully. + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: The reordered expense fields. + items: + $ref: '#/components/schemas/expense_field_out' + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/bulk_error' + - $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' /admin/dependent_expense_field_values: get: tags: @@ -937,6 +1128,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1054,6 +1249,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1090,6 +1289,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1136,6 +1339,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/dependent_expense_field_values_upload_out' @@ -1178,6 +1383,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1224,6 +1433,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/dependent_expense_field_values_download_out' @@ -1266,6 +1477,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1310,6 +1525,8 @@ paths: application/json: schema: type: object + required: + - data properties: url: type: string @@ -1355,6 +1572,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1403,6 +1624,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/per_diem_rate_out' @@ -1473,6 +1696,107 @@ paths: application/json: schema: $ref: '#/components/schemas/403' + /admin/per_diem_rates/delete/bulk: + post: + tags: + - Per Diem Rates + summary: Deletes per diem rates + description: | + Deletes unused per diem rates. If any of the per diem rate in input is used in other resources then validation error is raised. + operationId: per_diem_rates_delete_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/per_diem_rate_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + nullable: true + example: | + Can not delete per diem rate(s) used in other resources like expense. + data: + type: object + example: null + error: + type: string + example: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + /admin/per_diem_rates/delete_summary/bulk: + post: + tags: + - Per Diem Rates + summary: Create delete summary for per diem rates + description: | + Delete summary tells that how many per diem rates could be deleted from given per diem rates, it also + returns per diem rates that could be deleted. + operationId: per_diem_rates_delete_summary_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/per_diem_rate_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/per_diem_rate_delete_summary_out' + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' /admin/departments: get: tags: @@ -1489,6 +1813,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1537,6 +1865,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/department_out' @@ -1564,6 +1894,147 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /admin/departments/delete/bulk: + post: + tags: + - Departments + security: + - oauth2: + - '*' + summary: Delete departments + description: | + Deletes unused departments. If any supplied department is assigned to an employee or used + by a budget, expense policy, or expense rule, the request fails without deleting any + departments. A maximum of 200 unique department IDs can be processed. Repeated IDs are + deduplicated in first-seen order before the limit is enforced. + operationId: departments_delete_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/department_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + examples: + limit_exceeded: + summary: More than 200 unique department IDs supplied + value: + message: Cannot perform action for more than 200 departments at once. + data: null + error: InvalidUsage + dependency_blocked: + summary: A department is assigned or used by another resource + value: + message: Can not delete department(s) used in other resources like employee assignments, budgets, expense policy, expense rules. + data: null + error: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + /admin/departments/delete_summary/bulk: + post: + tags: + - Departments + security: + - oauth2: + - '*' + summary: Create delete summary for departments + description: | + Returns how many of the supplied departments can be deleted and lists those departments. + Departments assigned to employees or used by budgets, expense policies, or expense rules + are excluded. A maximum of 200 unique department IDs can be processed. Repeated IDs are + deduplicated in first-seen order before the limit is enforced. + operationId: departments_delete_summary_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/department_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/department_delete_summary_out' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Cannot perform action for more than 200 departments at once. + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' /admin/mileage_rates: get: tags: @@ -1580,6 +2051,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1626,6 +2101,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/mileage_rate_out' @@ -1653,6 +2130,210 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /admin/mileage_rates/bulk: + post: + operationId: mileage_rates_bulk_post + tags: + - Mileage Rates + security: + - oauth2: + - '*' + summary: Create or update mileage rates in bulk + description: | + Create or update mileage rates in bulk. The response is an empty object; re-fetch + `GET /admin/mileage_rates` after a successful request when the saved rows are needed. + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/mileage_rate_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/bulk_error' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + /admin/mileage_rates/delete/bulk: + post: + tags: + - Mileage Rates + security: + - oauth2: + - '*' + summary: Delete mileage rates + description: | + Deletes unused mileage rates. If any supplied mileage rate is used by an expense, + the request fails without deleting any rates. A maximum of 200 unique mileage rate + IDs can be processed. Repeated IDs are deduplicated in first-seen order before the + limit is enforced. + operationId: mileage_rates_delete_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/mileage_rate_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + examples: + limit_exceeded: + summary: More than 200 unique mileage rate IDs supplied + value: + message: Cannot perform action for more than 200 mileage rates at once. + data: null + error: InvalidUsage + dependency_blocked: + summary: A mileage rate is used by an expense + value: + message: Can not delete mileage rate(s) used in other resources like expense. + data: null + error: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + /admin/mileage_rates/delete_summary/bulk: + post: + tags: + - Mileage Rates + security: + - oauth2: + - '*' + summary: Create delete summary for mileage rates + description: | + Returns how many of the supplied mileage rates can be deleted and lists those rates. + A maximum of 200 unique mileage rate IDs can be processed. Repeated IDs are + deduplicated in first-seen order before the limit is enforced. + operationId: mileage_rates_delete_summary_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/mileage_rate_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/mileage_rate_delete_summary_out' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Cannot perform action for more than 200 mileage rates at once. + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' /admin/levels: get: tags: @@ -1669,6 +2350,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1715,6 +2400,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/level_out' @@ -1742,6 +2429,146 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /admin/levels/delete/bulk: + post: + tags: + - Levels + security: + - oauth2: + - '*' + summary: Delete levels + description: | + Deletes unused levels. If any supplied level is assigned to an employee or used in an + expense policy, the request fails without deleting any levels. A maximum of 200 unique + level IDs can be processed. Repeated IDs are deduplicated in first-seen order before the + limit is enforced. + operationId: levels_delete_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/level_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + examples: + limit_exceeded: + summary: More than 200 unique level IDs supplied + value: + message: Cannot perform action for more than 200 levels at once. + data: null + error: InvalidUsage + dependency_blocked: + summary: A level is assigned or used by another resource + value: + message: Can not delete level(s) used in other resources like employee assignments, expense policy. + data: null + error: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + /admin/levels/delete_summary/bulk: + post: + tags: + - Levels + security: + - oauth2: + - '*' + summary: Get levels delete summary + description: | + Returns levels that can be deleted from the supplied IDs. Levels assigned to employees or + used in expense policies are excluded. A maximum of 200 unique level IDs can be processed. + Repeated IDs are deduplicated in first-seen order before the limit is enforced. + operationId: levels_delete_summary_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/level_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/level_delete_summary_out' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Cannot perform action for more than 200 levels at once. + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' /admin/employees: get: tags: @@ -1760,6 +2587,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1809,6 +2640,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/employees_stats_out' @@ -1852,6 +2685,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1891,9 +2728,13 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: object + required: + - business_units properties: business_units: type: array @@ -1943,6 +2784,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/employees_exports_out' @@ -1982,9 +2825,13 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: object + required: + - titles properties: titles: type: array @@ -2025,9 +2872,13 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: object + required: + - locations properties: locations: type: array @@ -2186,6 +3037,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/employee_filters_out' @@ -2222,6 +3075,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -2265,6 +3120,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/employee_filters_out' @@ -2308,6 +3165,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2354,6 +3215,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/employees_upload_out' @@ -2397,6 +3260,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2443,6 +3310,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/employees_download_out' @@ -2488,6 +3357,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2531,6 +3404,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2671,6 +3548,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/employees_export_configuration_out' @@ -2810,6 +3689,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/file_out' @@ -2867,6 +3748,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -2943,6 +3826,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -3101,6 +3986,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/automate_report_submission_out' @@ -3142,6 +4029,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3191,6 +4082,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/automate_report_submission_out' @@ -3234,6 +4127,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3282,6 +4179,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/accounting_export_out' @@ -3325,6 +4224,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3373,6 +4276,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/accounting_export_lineitem_out' @@ -3472,6 +4377,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3506,6 +4415,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/admin_expense_in' @@ -3516,6 +4427,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_out' @@ -3543,6 +4456,63 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /admin/expenses/bulk: + post: + tags: + - Expenses + summary: Update expenses in bulk + description: | + Update expenses in bulk by admin. + operationId: admin_expenses_post_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/admin_expenses_bulk_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/expense_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' /admin/expenses/attach_files/bulk: post: tags: @@ -3573,6 +4543,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -3677,6 +4649,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_filters_out' @@ -3713,6 +4687,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3760,6 +4738,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_filters_out' @@ -3884,6 +4864,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expenses_stats_out' @@ -3911,6 +4893,73 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /admin/expenses/count: + get: + tags: + - Expenses + summary: Get expense count + description: | + Returns the number of expenses in the requested state that belong to enabled employees in the organization. + operationId: expenses_count + parameters: + - in: query + name: state + required: true + description: | + Valid expense state for which the count should be returned.
+ Supported operators are `eq`.
+ state=eq.DRAFT + schema: + type: string + example: eq.DRAFT + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/expenses_count_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + - error + - message + properties: + data: + type: object + nullable: true + example: null + error: + type: string + enum: + - InvalidUsage + message: + type: string + example: You don't have permissions to access this resource /admin/expenses/exports: post: tags: @@ -3937,6 +4986,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expenses_exports_out' @@ -3978,6 +5029,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -4104,6 +5159,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expenses_export_configuration_out' @@ -4245,6 +5302,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_permissions_out' @@ -4308,6 +5367,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_permissions_bulk_out' @@ -4374,6 +5435,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expenses_merge_in' @@ -4384,6 +5447,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_out' @@ -4426,6 +5491,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -4471,7 +5540,7 @@ paths: - data properties: data: - $ref: '#/components/schemas/advance_request_in' + $ref: '#/components/schemas/admin_advance_request_in' responses: '200': description: OK @@ -4480,6 +5549,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -4535,6 +5606,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_requests_stats_out' @@ -4590,6 +5663,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_permissions_out' @@ -4631,6 +5706,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_comments_in' @@ -4641,6 +5718,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_comments_out' @@ -4682,6 +5761,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_remove_approver_in' @@ -4696,6 +5777,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -4748,6 +5831,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -4802,6 +5889,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_out' @@ -4912,6 +6001,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advances_stats_out' @@ -4954,6 +6045,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -5008,6 +6103,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_wallet_out' @@ -5050,6 +6147,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -5104,6 +6205,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_refund_out' @@ -5213,6 +6316,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -5256,6 +6361,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -5304,6 +6413,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/reminder_out' @@ -5358,6 +6469,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -5413,6 +6526,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -5458,6 +6573,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -5562,6 +6681,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_report_out' @@ -5609,6 +6730,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/report_filters_out' @@ -5645,6 +6768,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: data: type: array @@ -5692,6 +6819,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/report_filters_out' @@ -5746,6 +6875,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_comments_out' @@ -5795,6 +6926,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_report_out' @@ -5848,6 +6981,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/admin_report_out' @@ -5958,6 +7093,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_report_out' @@ -5985,14 +7122,14 @@ paths: application/json: schema: $ref: '#/components/schemas/404' - /admin/reports/process_ach/bulk: + /admin/reports/revert_to_processing: post: tags: - Reports - summary: Process ACH + summary: Revert report to Processing description: | - Process ACH - operationId: reports_process_ach + Move a Closed report back to Processing state. + operationId: report_revert_to_processing requestBody: required: true content: @@ -6004,30 +7141,26 @@ paths: - data properties: data: - type: array - items: - $ref: '#/components/schemas/process_ach_in' + $ref: '#/components/schemas/revert_to_processing_in' responses: '200': description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/admin_report_out' '400': description: Bad request content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/bulk_error' - - type: object - properties: - error: - type: string - nullable: true - message: - type: string - nullable: true - data: - type: object - nullable: true + $ref: '#/components/schemas/400' '401': description: Unauthorized request content: @@ -6039,21 +7172,26 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/403' + type: object + properties: + message: + type: string + description: | + This error means current user does not have enough permissions to perform this operation. '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/404' - /admin/reports/mark_paid/bulk: + /admin/reports/revert_to_approved: post: tags: - Reports - summary: Mark reports as Paid + summary: Revert report to Approved state description: | - Mark reports as Paid. - operationId: reports_mark_paid + Move a Closed or Processing report back to Approved state. + operationId: report_revert_to_approved requestBody: required: true content: @@ -6065,30 +7203,26 @@ paths: - data properties: data: - type: array - items: - $ref: '#/components/schemas/mark_paid_bulk_in' + $ref: '#/components/schemas/revert_to_approved_in' responses: '200': description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/admin_report_out' '400': description: Bad request content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/bulk_error' - - type: object - properties: - error: - type: string - nullable: true - message: - type: string - nullable: true - data: - type: object - nullable: true + $ref: '#/components/schemas/400' '401': description: Unauthorized request content: @@ -6100,21 +7234,26 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/403' + type: object + properties: + message: + type: string + description: | + This error means current user does not have enough permissions to perform this operation. '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/404' - /admin/reports/process_manual/bulk: + /admin/reports/process_ach/bulk: post: tags: - Reports - summary: Process Manual + summary: Process ACH description: | - Process reports manually - operationId: reports_process_manual + Process ACH + operationId: reports_process_ach requestBody: required: true content: @@ -6128,7 +7267,129 @@ paths: data: type: array items: - $ref: '#/components/schemas/process_manual_in' + $ref: '#/components/schemas/process_ach_in' + responses: + '200': + description: OK + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/bulk_error' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reports/mark_paid/bulk: + post: + tags: + - Reports + summary: Mark reports as Paid + description: | + Mark reports as Paid. + operationId: reports_mark_paid + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/mark_paid_bulk_in' + responses: + '200': + description: OK + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/bulk_error' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reports/process_manual/bulk: + post: + tags: + - Reports + summary: Process Manual + description: | + Process reports manually + operationId: reports_process_manual + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/process_manual_in' responses: '200': description: OK @@ -6197,6 +7458,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -6326,6 +7589,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/reports_stats_out' @@ -6393,6 +7658,62 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /admin/reports/resubmit: + post: + tags: + - Reports + summary: Resubmit an employee's report + description: Resubmit an employee's report that is in the `APPROVER_INQUIRY` state. + operationId: report_resubmit + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/report_action_resubmit' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/admin_report_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' /admin/reports/permissions: post: tags: @@ -6421,6 +7742,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_permissions_out' @@ -6475,6 +7798,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_report_out' @@ -6524,6 +7849,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_report_out' @@ -6571,6 +7898,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/admin_report_out' @@ -6606,6 +7935,11 @@ paths: content: application/json: schema: + type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -6652,6 +7986,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/reports_exports_out' @@ -6693,6 +8029,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -6742,6 +8082,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/reports_export_configuration_out' @@ -6875,6 +8217,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -6921,6 +8267,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_out' @@ -7018,9 +8366,13 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: object + required: + - bank_names properties: bank_names: type: array @@ -7061,6 +8413,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: object @@ -7113,6 +8467,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_stats_out' @@ -7167,6 +8523,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_out' @@ -7221,6 +8579,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_unassign_out' @@ -7275,6 +8635,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_out' @@ -7329,6 +8691,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_out' @@ -7356,56 +8720,14 @@ paths: application/json: schema: $ref: '#/components/schemas/404' - /admin/corporate_card_transactions: - get: - tags: - - Corporate Card Transactions - summary: List corporate card transactions - description: | - This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) - operationId: corporate_card_transactions_list - parameters: - - $ref: '#/components/parameters/created_at' - - $ref: '#/components/parameters/updated_at' - - $ref: '#/components/parameters/order' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/q' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - count: - $ref: '#/components/schemas/count' - offset: - $ref: '#/components/schemas/offset' - data: - type: array - items: - $ref: '#/components/schemas/corporate_card_transaction_list_out' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400' - '401': - description: Unauthorized request - content: - application/json: - schema: - $ref: '#/components/schemas/401' + /admin/corporate_cards/merge: post: tags: - - Corporate Card Transactions - summary: Create or update corporate card transaction + - Corporate Cards + summary: Merge Duplicate Corporate Cards description: | - Create or update an corporate card transactions. - operationId: corporate_card_transactions_post + Merges a source card into a destination card by consolidating all associated data into the destination and removing the source card. + operationId: corporate_cards_merge requestBody: required: true content: @@ -7414,9 +8736,10 @@ paths: type: object properties: data: - $ref: '#/components/schemas/corporate_card_transaction_in' + $ref: '#/components/schemas/corporate_card_merge_in' required: - data + additionalProperties: false responses: '200': description: OK @@ -7424,9 +8747,495 @@ paths: application/json: schema: type: object + required: + - data properties: data: - $ref: '#/components/schemas/corporate_card_transaction_post_out' + $ref: '#/components/schemas/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/corporate_cards/archive: + post: + tags: + - Corporate Cards + summary: Archive a corporate card + description: | + Archive a corporate card + operationId: corporate_cards_archive + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/corporate_card_archive_in' + required: + - data + additionalProperties: false + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/corporate_cards/unarchive: + post: + tags: + - Corporate Cards + summary: Unarchive a corporate card + description: | + Unarchive a corporate card + operationId: corporate_cards_unarchive + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/corporate_card_unarchive_in' + required: + - data + additionalProperties: false + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/corporate_cards/unarchive/bulk: + post: + tags: + - Corporate Cards + summary: Bulk unarchive corporate cards + description: | + Unarchive corporate cards in bulk. + operationId: corporate_cards_unarchive_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/corporate_card_unarchive_in' + required: + - data + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/bulk_error' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + /admin/corporate_cards/duplicate_suggestions: + get: + tags: + - Corporate Cards + summary: List corporate card duplicate suggestions + description: | + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: corporate_card_duplicate_suggestions_list + parameters: + - $ref: '#/components/parameters/q' + - $ref: '#/components/parameters/created_at' + - $ref: '#/components/parameters/updated_at' + - $ref: '#/components/parameters/order' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/limit' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: array + items: + $ref: '#/components/schemas/corporate_card_duplicate_suggestion_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + /admin/corporate_cards/duplicate_suggestions/dismiss: + post: + tags: + - Corporate Cards + summary: Dismiss a corporate card duplicate suggestion + description: | + Dismiss a corporate card duplicate suggestion + operationId: corporate_cards_dismiss_duplicate_suggestion + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/corporate_card_duplicate_suggestion_dismiss_in' + required: + - data + additionalProperties: false + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/corporate_card_duplicate_suggestion_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/corporate_cards/archive_suggestions: + get: + tags: + - Corporate Cards + summary: List corporate card archive suggestions + description: | + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: corporate_card_archive_suggestions_list + parameters: + - $ref: '#/components/parameters/q' + - $ref: '#/components/parameters/created_at' + - $ref: '#/components/parameters/updated_at' + - $ref: '#/components/parameters/order' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/limit' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: array + items: + $ref: '#/components/schemas/corporate_card_archive_suggestion_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + /admin/corporate_cards/archive_suggestions/dismiss: + post: + tags: + - Corporate Cards + summary: Dismiss a corporate card archive suggestion + description: | + Dismiss a corporate card archive suggestion + operationId: corporate_cards_archive_suggestion_dismiss + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/corporate_card_archive_suggestion_dismiss_in' + required: + - data + additionalProperties: false + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/corporate_card_archive_suggestion_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/corporate_card_transactions: + get: + tags: + - Corporate Card Transactions + summary: List corporate card transactions + description: | + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: corporate_card_transactions_list + parameters: + - $ref: '#/components/parameters/created_at' + - $ref: '#/components/parameters/updated_at' + - $ref: '#/components/parameters/order' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/q' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: array + items: + $ref: '#/components/schemas/corporate_card_transaction_list_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + post: + tags: + - Corporate Card Transactions + summary: Create or update corporate card transaction + description: | + Create or update an corporate card transactions. + operationId: corporate_card_transactions_post + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/corporate_card_transaction_in' + required: + - data + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/corporate_card_transaction_post_out' '400': description: Bad request content: @@ -7532,6 +9341,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -7589,6 +9400,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -7646,6 +9459,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -7702,6 +9517,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_filters_out' @@ -7738,6 +9555,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -7781,6 +9600,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_filters_out' @@ -7834,6 +9655,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_assign_out' @@ -7995,6 +9818,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_unassign_out' @@ -8048,6 +9873,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_mark_personal_out' @@ -8155,6 +9982,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_unmark_personal_out' @@ -8208,6 +10037,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_ignore_out' @@ -8315,6 +10146,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_undo_ignore_out' @@ -8368,6 +10201,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_match_out' @@ -8421,6 +10256,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_unmatch_out' @@ -8474,6 +10311,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transactions_exports_out' @@ -8516,6 +10355,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -8564,6 +10407,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/virtual_cards_get_current_balance_out' @@ -8618,6 +10463,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/virtual_cards_show_card_details_out' @@ -8672,6 +10519,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/virtual_card_out' @@ -8713,6 +10562,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_subscriptions_in' @@ -8724,6 +10575,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/admin_subscriptions_out' @@ -8773,6 +10626,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -8816,6 +10673,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -8902,6 +10763,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -8957,6 +10822,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/schedule_out' @@ -8998,6 +10865,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9041,6 +10912,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/scheduled_callback_out' @@ -9082,6 +10955,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9126,6 +11003,8 @@ paths: application/json: schema: type: object + required: + - data properties: time_interval_granularity: $ref: '#/components/schemas/time_interval_granularity' @@ -9184,6 +11063,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9242,6 +11125,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9300,6 +11187,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9358,6 +11249,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9416,6 +11311,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9474,6 +11373,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9523,6 +11426,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9571,6 +11478,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/account_out' @@ -9608,6 +11517,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9656,6 +11569,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/tax_group_out' @@ -9766,9 +11681,11 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: - $ref: '#/components/schemas/budget_out' + $ref: '#/components/schemas/budget_post_out' '400': description: Bad request content: @@ -9807,6 +11724,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9847,6 +11768,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9868,6 +11793,57 @@ paths: application/json: schema: $ref: '#/components/schemas/401' + /admin/budgets/export: + post: + tags: + - Budgets + summary: Create Budget Export + description: | + Create a Budget Export Request. This exports budget data with the following columns: + Budget Name, Budget Frequency, Budget Amount, Utilisation (%, Amount), Remaining, Status, Created By, Start Date. + The export is generated in xlsx format. + operationId: budgets_exports_post + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/budget_exports_in' + required: + - data + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/budget_exports_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' /admin/orgs: get: tags: @@ -9884,6 +11860,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -9960,32 +11940,19 @@ paths: application/json: schema: $ref: '#/components/schemas/401' - /admin/expense_policy_rules: - post: + /admin/orgs/weekly_invitation_usage: + get: tags: - - Expense Policies - summary: Create or Update Expense Policy Rules + - Organisations + summary: Get weekly employee invitation usage description: | - Create or Update Expense Policy Rules
- **Apart from the required fields mentioned below, the request body should contain the following:** - - You should choose at least one condition from **expense_*** or **employee_***. - - You should choose at least one action from **action_***.

- _When multiple conditions are provided, then there will AND operation in between them and the policy rule - will only be applicable on expenses if all of the conditions match.
- Similarly, for actions, if multiple actions are provided then all of the actions will be applied when conditions satisfy._ - operationId: expense_policy_rules_post - requestBody: - required: true - content: - application/json: - schema: - type: object - additionalProperties: false - required: - - data - properties: - data: - $ref: '#/components/schemas/expense_policy_in' + This API returns the current week's employee invitation usage for the organisation. + It shows how many invitations have been sent this week, the configured weekly limit, + and whether the limit has been reached. + + If the organisation is still within its onboarding period, no weekly limit is enforced + and `weekly_limit` will be `null`. + operationId: orgs_get_weekly_invitation_usage responses: '200': description: OK @@ -9994,9 +11961,11 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: - $ref: '#/components/schemas/expense_policy_out' + $ref: '#/components/schemas/org_weekly_invitation_usage_out' '400': description: Bad request content: @@ -10015,88 +11984,20 @@ paths: application/json: schema: $ref: '#/components/schemas/403' - get: - tags: - - Expense Policies - summary: Get Expense Policy Rules - operationId: expense_policy_rules_get - parameters: - - in: query - name: id - description: | - The id of the expense policy rule.
- Supported operators are `eq`, `in`, `neq`, `not_in`.
- id=eq."id"
- id=in.("id1","id2","id3")
- id=neq."id"
- id=not_in.("id1","id2","id3") - > If no id is passed then all the expense policy rules of the org will be returned. - schema: - type: string - example: eq."tprmdNPsd" - - in: query - name: is_enabled - description: | - Whether to fetch only active expense policy rule.
- Supported operators are `eq`.
- is_enabled=eq.true
- is_enabled=eq.false - schema: - type: string - example: eq.true - - in: query - name: is_retired - description: | - Whether to fetch retired expense policy rule.
- Supported operators are `eq`.
- is_retired=eq.true
- is_retired=eq.false - schema: - type: string - example: eq.true - - in: query - name: is_approver_policy - description: | - Whether to fetch expense policy rules that add an approver to an expense on violation.
- Supported operators are `eq`.
- is_approver_policy=eq.true
- is_approver_policy=eq.false - schema: - type: string - example: eq.true - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - additionalProperties: false - properties: - count: - $ref: '#/components/schemas/count' - offset: - $ref: '#/components/schemas/offset' - data: - type: array - items: - $ref: '#/components/schemas/expense_policy_out' - '401': - description: Unauthorized request - content: - application/json: - schema: - $ref: '#/components/schemas/401' - /admin/expense_policy_rules/enable: + /admin/expense_policy_rules: post: tags: - Expense Policies - summary: Enable an Expense Policy Rule + summary: Create or Update Expense Policy Rules description: | - Enable an Expense Policy Rule - operationId: expense_policy_rules_enable + Create or Update Expense Policy Rules
+ **Apart from the required fields mentioned below, the request body should contain the following:** + - You should choose at least one condition from **expense_*** or **employee_***. + - You should choose at least one action from **action_***.

+ _When multiple conditions are provided, then there will AND operation in between them and the policy rule + will only be applicable on expenses if all of the conditions match.
+ Similarly, for actions, if multiple actions are provided then all of the actions will be applied when conditions satisfy._ + operationId: expense_policy_rules_post requestBody: required: true content: @@ -10108,7 +12009,7 @@ paths: - data properties: data: - $ref: '#/components/schemas/expense_policy_state_change_in' + $ref: '#/components/schemas/expense_policy_in' responses: '200': description: OK @@ -10117,6 +12018,137 @@ paths: schema: type: object additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/expense_policy_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + get: + tags: + - Expense Policies + summary: Get Expense Policy Rules + operationId: expense_policy_rules_get + parameters: + - in: query + name: id + description: | + The id of the expense policy rule.
+ Supported operators are `eq`, `in`, `neq`, `not_in`.
+ id=eq."id"
+ id=in.("id1","id2","id3")
+ id=neq."id"
+ id=not_in.("id1","id2","id3") + > If no id is passed then all the expense policy rules of the org will be returned. + schema: + type: string + example: eq."tprmdNPsd" + - in: query + name: is_enabled + description: | + Whether to fetch only active expense policy rule.
+ Supported operators are `eq`.
+ is_enabled=eq.true
+ is_enabled=eq.false + schema: + type: string + example: eq.true + - in: query + name: is_retired + description: | + Whether to fetch retired expense policy rule.
+ Supported operators are `eq`.
+ is_retired=eq.true
+ is_retired=eq.false + schema: + type: string + example: eq.true + - in: query + name: is_approver_policy + description: | + Whether to fetch expense policy rules that add an approver to an expense on violation.
+ Supported operators are `eq`.
+ is_approver_policy=eq.true
+ is_approver_policy=eq.false + schema: + type: string + example: eq.true + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + - count + - offset + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: array + items: + $ref: '#/components/schemas/expense_policy_out' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + /admin/expense_policy_rules/enable: + post: + tags: + - Expense Policies + summary: Enable an Expense Policy Rule + description: | + Enable an Expense Policy Rule + operationId: expense_policy_rules_enable + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/expense_policy_state_change_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_policy_out' @@ -10172,6 +12204,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_policy_out' @@ -10279,6 +12313,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -10333,6 +12371,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -10380,6 +12422,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/statements_out' @@ -10428,6 +12472,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -10483,15 +12531,15 @@ paths: application/json: schema: type: object + required: + - data properties: count: $ref: '#/components/schemas/count' offset: $ref: '#/components/schemas/offset' data: - type: object - items: - $ref: '#/components/schemas/statement_mappings_suggest_out' + $ref: '#/components/schemas/statement_mappings_suggest_out' '400': description: Bad request content: @@ -10536,6 +12584,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/preview_out' @@ -10589,6 +12639,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -10644,11 +12696,11 @@ paths: application/json: schema: type: object + required: + - data properties: data: - type: array - items: - $ref: '#/components/schemas/reconciliation_summary_out' + $ref: '#/components/schemas/reconciliation_summary_out' '400': description: Bad request content: @@ -10699,6 +12751,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: object @@ -10754,6 +12808,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -10809,6 +12865,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/card_stats_out' @@ -10862,6 +12920,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -10954,11 +13014,11 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: - type: object - items: - $ref: '#/components/schemas/rtf_missing_transaction_from_statement_out' + $ref: '#/components/schemas/rtf_missing_transaction_from_statement_out' '400': description: Bad Request content: @@ -11033,11 +13093,122 @@ paths: schema: type: object additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/rtf_stats_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/statements/archived_cards: + post: + tags: + - Statements + summary: Archived cards present in Sage Exp Mgmt + description: | + Returns archived cards present in Sage Exp Mgmt for cards in Statement + operationId: archived_cards + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/statement_archived_cards_in' + required: + - data + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/statement_archived_cards_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/statements/archived_cards/ignore: + post: + tags: + - Statements + summary: Ignore archived cards present in the statement + description: | + Ignores archived cards present in the statement + operationId: ignore_archived_cards + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/statement_archived_cards_ignore_in' + required: + - data + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data properties: data: type: object - items: - $ref: '#/components/schemas/rtf_stats_out' + description: Empty object on successfully ignoring archived cards '400': description: Bad request content: @@ -11127,6 +13298,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -11315,6 +13490,118 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /admin/expenses/check_mandatory_fields/bulk: + post: + tags: + - Expenses + summary: Check multiple expenses for missing mandatory fields in bulk + description: | + Before updating multiple expense objects as an admin, you can validate + if all mandatory fields are present using this bulk endpoint. + operationId: admin_check_mandatory_fields_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/admin_expense_check_mandatory_fields_bulk_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/expense_check_mandatory_fields_bulk_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/expenses/check_policies/bulk: + post: + tags: + - Expenses + summary: Check multiple expenses for policy violations in bulk + description: | + Admin bulk version of the check_policies API that allows checking + multiple expenses for policy violations in one request. + + **NOTE:** This API can only be used to check policies for existing expenses that you want to update. The API will evaluate all the expenses against the configured policy rules and return an array of policy violation information for each expense in the request payload. + operationId: admin_check_policies_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/admin_check_policies_bulk_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/expense_check_policies_bulk_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' /admin/expenses/comments: get: tags: @@ -11331,6 +13618,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -11374,6 +13665,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_comments_bulk_in' @@ -11384,6 +13677,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -11490,6 +13785,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -11535,6 +13832,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expenses_duplicate_sets_stats_out' @@ -11577,6 +13876,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -11667,6 +13970,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/admin_split_expense_in' @@ -11677,6 +13982,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -11722,6 +14029,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/admin_split_expense_in' @@ -11732,6 +14041,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -11778,6 +14089,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/admin_split_expense_in' @@ -11788,6 +14101,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -11833,6 +14148,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -11875,6 +14194,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -11920,6 +14243,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -12060,6 +14387,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -12087,36 +14418,40 @@ paths: application/json: schema: $ref: '#/components/schemas/403' - /admin/reconciliation_entries/eligible_cards: - get: + /admin/reconciliation_entries/transactions/reconcile/bulk: + post: tags: - Reconciliation - summary: List eligible cards for a reconciliation entry + summary: Bulk reconcile reconciliation transactions description: | - Returns the list of corporate cards that are eligible for a given reconciliation entry. - To understand filtering, ordering and pagination, see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) - operationId: reconciliation_entries_eligible_cards_list - parameters: - - in: query - name: reconciliation_entry_id - required: true - schema: - type: string - example: receabc12345 - description: | - Reconciliation entry id for which eligible cards should be listed. - - in: query - name: status - required: false - schema: - type: string - example: RECONCILED - description: | - Optional status filter for eligible cards. - - $ref: '#/components/parameters/q' - - $ref: '#/components/parameters/order' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/limit' + Reconcile multiple reconciliation transactions in bulk. + operationId: reconciliation_transactions_reconcile_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: List of reconciliation transaction identifiers to reconcile. + items: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Unique id of the reconciliation transaction to reconcile. + example: rectx8abc123 + example: + - id: rectx8abc123 + - id: rectx8xyz789 responses: '200': description: OK @@ -12124,21 +14459,32 @@ paths: application/json: schema: type: object + additionalProperties: false + required: + - data properties: - count: - $ref: '#/components/schemas/count' - offset: - $ref: '#/components/schemas/offset' data: - type: array - items: - $ref: '#/components/schemas/reconciliation_eligible_card_out' + type: object + description: Result of bulk reconcile. Empty object on success. + example: {} '400': description: Bad request content: application/json: schema: - $ref: '#/components/schemas/400' + oneOf: + - $ref: '#/components/schemas/bulk_error' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true '401': description: Unauthorized request content: @@ -12157,16 +14503,14 @@ paths: application/json: schema: $ref: '#/components/schemas/404' - /admin/reconciliation_entries/eligible_cards/stats: + /admin/reconciliation_entries/transactions/match_and_reconcile/bulk: post: tags: - Reconciliation - summary: Stats for eligible cards of a reconciliation entry + summary: Bulk match and reconcile reconciliation transactions description: | - Returns aggregate stats for corporate cards eligible under a reconciliation entry. - - Use this endpoint to get period window, transaction and expense totals, differences, and card-level aggregate counts such as matching issues and reconciliation status. - operationId: reconciliation_entries_eligible_cards_stats + Match reconciliation transactions with target transactions/expenses and reconcile in bulk. + operationId: reconciliation_transactions_match_and_reconcile_bulk requestBody: required: true content: @@ -12178,7 +14522,28 @@ paths: - data properties: data: - $ref: '#/components/schemas/reconciliation_eligible_cards_stats_in' + type: array + description: List of source and target reconciliation transaction identifiers to match and reconcile. + items: + type: object + additionalProperties: false + required: + - source_id + - target_id + properties: + source_id: + type: string + description: Source reconciliation transaction id. + example: rectx8abc123 + target_id: + type: string + description: Target reconciliation transaction or expense id to match with. + example: rectx8xyz789 + example: + - source_id: rectx8abc123 + target_id: rectx8xyz789 + - source_id: rectx8def456 + target_id: rectx8uvw000 responses: '200': description: OK @@ -12187,9 +14552,93 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: - $ref: '#/components/schemas/reconciliation_eligible_cards_stats_out' + type: object + description: Result of bulk match and reconcile. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/bulk_error' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reconciliation_entries/transactions/find_match: + post: + tags: + - Reconciliation + summary: Find matches for a reconciliation transaction + description: | + Find potential matching expenses for a reconciliation transaction. + operationId: reconciliation_transactions_find_match + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Unique id of the reconciliation transaction for which to find matches. + example: rectx8abc123 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + additionalProperties: false + properties: + data: + type: array + description: List of potential matches for the provided reconciliation transaction. + items: + $ref: '#/components/schemas/reconciliation_transaction_out' '400': description: Bad request content: @@ -12243,6 +14692,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -12271,46 +14722,608 @@ paths: application/json: schema: $ref: '#/components/schemas/404' - /admin/reconciliation_entries/transactions/move_to_next_period/bulk: + /admin/reconciliation_entries/eligible_cards: + get: + tags: + - Reconciliation + summary: List eligible cards for a reconciliation entry + description: | + Returns the list of corporate cards that are eligible for a given reconciliation entry. + To understand filtering, ordering and pagination, see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: reconciliation_entries_eligible_cards_list + parameters: + - in: query + name: reconciliation_entry_id + required: true + schema: + type: string + example: receabc12345 + description: | + Reconciliation entry id for which eligible cards should be listed. + - in: query + name: status + required: false + schema: + type: string + example: RECONCILED + description: | + Optional status filter for eligible cards. + - $ref: '#/components/parameters/q' + - $ref: '#/components/parameters/order' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/limit' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: array + items: + $ref: '#/components/schemas/reconciliation_eligible_card_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reconciliation_entries/eligible_cards/stats: + post: + tags: + - Reconciliation + summary: Stats for eligible cards of a reconciliation entry + description: | + Returns aggregate stats for corporate cards eligible under a reconciliation entry. + + Use this endpoint to get period window, transaction and expense totals, differences, and card-level aggregate counts such as matching issues and reconciliation status. + operationId: reconciliation_entries_eligible_cards_stats + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/reconciliation_eligible_cards_stats_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/reconciliation_eligible_cards_stats_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reconciliation_entries/eligible_cards/exports: + post: + tags: + - Reconciliation + summary: Create eligible cards export + description: | + Create an export request for reconciliation eligible cards. The export is processed asynchronously. + When ready, the specified notify_emails will receive the export file. Use query_params to filter + the eligible cards (e.g. reconciliation_entry_id=eq.). + operationId: reconciliation_eligible_cards_exports_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/reconciliation_export_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/reconciliation_export_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reconciliation_entries/transactions/delete/bulk: + post: + tags: + - Reconciliation + summary: Bulk delete reconciliation transactions + description: | + Delete multiple reconciliation transactions in bulk. + operationId: reconciliation_transactions_delete_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: List of reconciliation transaction identifiers to delete. + items: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Unique id of the reconciliation transaction to delete. + example: rectx8abc123 + example: + - id: rectx8abc123 + - id: rectx8xyz789 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + description: Result of bulk delete. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/bulk_error' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reconciliation_entries/transactions/unmatch/bulk: + post: + tags: + - Reconciliation + summary: Bulk unmatch reconciliation transactions + description: | + Unmatch multiple reconciliation transactions in bulk. + operationId: reconciliation_transactions_unmatch_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: List of reconciliation transaction identifiers to unmatch. + items: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Unique id of the reconciliation transaction to unmatch. + example: rectx8abc123 + example: + - id: rectx8abc123 + - id: rectx8xyz789 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + description: Result of bulk unmatch. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/bulk_error' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reconciliation_entries/transactions/move_to_next_period/bulk: + post: + tags: + - Reconciliation + summary: Move reconciliation transactions to next period + description: | + This API moves one or more reconciliation transactions from their current reconciliation period + to the next reconciliation period. This is useful when transactions need to be deferred to a + future reconciliation cycle. + operationId: post_move_to_next_period_reconciliation_transactions_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/move_to_next_period_from_reconciliation_transaction_in' + description: List of reconciliation transaction objects to move to the next period. + example: + - id: rectx8abc123 + - id: rectx9def456 + required: + - data + responses: + '200': + description: OK - Transactions successfully moved to next period + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + description: Empty object on success + '400': + description: Bad request - Invalid transaction IDs, transactions already reconciled, transactions from different periods, or inconsistent reconciliation entries + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden - User doesn't have required permissions (ADMIN, FINANCE, VERIFIER, PAYMENT_PROCESSOR, or AUDITOR role required) + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found - Reconciliation transaction not found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reconciliation_entries/transactions/resolve_multi_matches: + post: + tags: + - Reconciliation + summary: Resolve multiple matches for a reconciliation transaction + description: | + Resolve multiple potential matches by selecting a specific expense for a reconciliation transaction. + operationId: reconciliation_transactions_resolve_multi_matches + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + additionalProperties: false + required: + - id + - expense_id + properties: + id: + type: string + description: Reconciliation transaction id for which to resolve multiple matches. + example: rectx8abc123 + expense_id: + type: string + description: Selected expense id to resolve against. + example: txuXDH16HzK + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + description: Result of resolve operation. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reconciliation_entries/transactions/exports: + post: + tags: + - Reconciliation + summary: Create transactions export + description: | + Create an export request for reconciliation transactions. The export is processed asynchronously. + When ready, the specified notify_emails will receive the export file. Use query_params to filter + the transactions (e.g. reconciliation_entry_id=eq.). + operationId: reconciliation_transactions_exports_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/reconciliation_export_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/reconciliation_export_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /admin/reconciliation_entries/close: post: tags: - Reconciliation - summary: Move reconciliation transactions to next period + summary: Close reconciliation entry description: | - This API moves one or more reconciliation transactions from their current reconciliation period - to the next reconciliation period. This is useful when transactions need to be deferred to a - future reconciliation cycle. - operationId: post_move_to_next_period_reconciliation_transactions_bulk + Mark a reconciliation entry as reconciled/closed. + operationId: reconciliation_entries_close requestBody: required: true content: application/json: schema: type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/move_to_next_period_from_reconciliation_transaction_in' - description: List of reconciliation transaction objects to move to the next period. - example: - - id: rectx8abc123 - - id: rectx9def456 + additionalProperties: false required: - data + properties: + data: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Reconciliation entry id to close. + example: receabc12345 responses: '200': - description: OK - Transactions successfully moved to next period + description: OK content: application/json: schema: type: object + additionalProperties: false + required: + - data properties: data: type: object - description: Empty object on success + description: Result of close operation. Empty object on success. + example: {} '400': - description: Bad request - Invalid transaction IDs, transactions already reconciled, transactions from different periods, or inconsistent reconciliation entries + description: Bad request content: application/json: schema: @@ -12322,13 +15335,13 @@ paths: schema: $ref: '#/components/schemas/401' '403': - description: Forbidden - User doesn't have required permissions (ADMIN, FINANCE, VERIFIER, PAYMENT_PROCESSOR, or AUDITOR role required) + description: Forbidden content: application/json: schema: $ref: '#/components/schemas/403' '404': - description: Not Found - Reconciliation transaction not found + description: Not Found content: application/json: schema: @@ -12472,6 +15485,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -12579,6 +15594,9 @@ paths: type: array items: type: object + required: + - comment_type + - comment_text properties: comment_type: type: string @@ -12608,6 +15626,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: object @@ -12668,6 +15688,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_add_approver_in' @@ -12683,6 +15705,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -12752,6 +15776,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -12815,6 +15841,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -12871,7 +15899,7 @@ paths: - data properties: data: - $ref: '#/components/schemas/advance_request_in' + $ref: '#/components/schemas/advance_request_submit_in' responses: '200': description: OK @@ -12880,6 +15908,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -12932,6 +15962,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_custom_fields_out' @@ -12983,6 +16015,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_custom_field_out' @@ -13036,6 +16070,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: allOf: @@ -13080,6 +16116,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/dwolla_customer_out' @@ -13121,6 +16159,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -13261,6 +16303,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transactions_export_configuration_out' @@ -13378,7 +16422,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions @@ -13544,6 +16588,10 @@ components: user_out_embed: type: object additionalProperties: false + required: + - id + - email + - full_name properties: id: allOf: @@ -13560,6 +16608,22 @@ components: admin_approver_project_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - sub_project + - display_name + - is_enabled + - code + - description + - restricted_spender_user_ids + - approver_user_ids + - approver_users + - category_ids + - default_billable properties: id: $ref: '#/components/schemas/id_integer' @@ -13611,6 +16675,12 @@ components: type: integer example: 16570 description: List of categories that are applicable for the project. + default_billable: + type: boolean + nullable: true + description: | + Default billable flag for expenses using this project. + `null` indicates the default is not set. project_in: type: object additionalProperties: false @@ -13654,78 +16724,210 @@ components: - `null` value indicates that all users in the org can access this object. - `[]` value indicates that no users in the org can access this object. - **Note:** - - **_When the `restrict employee to their own projects` feature is disabled, only `null` value is accepted._** - - _If the `restrict employee to their own projects` feature is **disabled**, then the default value while creating project is `null`._ - - _If the `restrict employee to their own projects` feature is **enabled**, then the default value while creating project is `[]`._ - approver_user_ids: - allOf: - - $ref: '#/components/schemas/approver_user_ids' - description: | - - List of IDs of users who are approvers of the project. - - Either `approver_user_ids` or `approver_emails` can be used but not both. - - The default value for approver_user_ids is `[]` and it is applicable only when creating the project. - approver_emails: - type: array - maxItems: 2 - nullable: false - items: - type: string - maxLength: 127 - nullable: true - example: john.doe@example.com - description: | - An immutable field that represents the email address of the employee. - Must be compliant with RFC 822. - example: - - approver1@example.com - - approver2@example.com - description: | - - List of emails of employees that are approvers for the project. - - Either `approver_user_ids` or `approver_emails` can be used but not both. - - The default value for approver_emails is `[]` and it is applicable only when creating the project. - category_ids: - type: array - nullable: true - items: - $ref: '#/components/schemas/id_integer' - example: - - 87291 - - 78322 - - 492 - description: | - - List of IDs of categories which can be used with the project. - - `null` value indicates that all categories in the org are applicable for the project. - - `[]` value indicates that no category in the org is applicable for the project. - - The default value of `category_ids` is `null` - bulk_error: - type: object - properties: - error: - type: string - example: BulkError - message: - type: string - nullable: true - data: - type: array - items: - type: object - properties: - row: - type: integer - description: | - This holds the info of which row contains bad data. - key: - oneOf: - - type: string - - type: integer - description: | - This helps in identifying the error by unique key. - message: - type: string - description: | - This explains what the error is in `human readable` text - project_in_only_id: + - **_When the `restrict employee to their own projects` feature is disabled, only `null` value is accepted._** + - _If the `restrict employee to their own projects` feature is **disabled**, then the default value while creating project is `null`._ + - _If the `restrict employee to their own projects` feature is **enabled**, then the default value while creating project is `[]`._ + approver_user_ids: + allOf: + - $ref: '#/components/schemas/approver_user_ids' + description: | + - List of IDs of users who are approvers of the project. + - Either `approver_user_ids` or `approver_emails` can be used but not both. + - The default value for approver_user_ids is `[]` and it is applicable only when creating the project. + approver_emails: + type: array + maxItems: 2 + nullable: false + items: + type: string + maxLength: 127 + nullable: true + example: john.doe@example.com + description: | + An immutable field that represents the email address of the employee. + Must be compliant with RFC 822. + example: + - approver1@example.com + - approver2@example.com + description: | + - List of emails of employees that are approvers for the project. + - Either `approver_user_ids` or `approver_emails` can be used but not both. + - The default value for approver_emails is `[]` and it is applicable only when creating the project. + category_ids: + type: array + nullable: true + items: + $ref: '#/components/schemas/id_integer' + example: + - 87291 + - 78322 + - 492 + description: | + - List of IDs of categories which can be used with the project. + - `null` value indicates that all categories in the org are applicable for the project. + - `[]` value indicates that no category in the org is applicable for the project. + - The default value of `category_ids` is `null` + default_billable: + type: boolean + nullable: true + description: | + Default billable flag for expenses using this project. + `null` indicates the default is not set. + example: true + bulk_error: + type: object + properties: + error: + type: string + example: BulkError + message: + type: string + nullable: true + data: + type: array + items: + type: object + properties: + row: + type: integer + description: | + This holds the info of which row contains bad data. + key: + oneOf: + - type: string + - type: integer + description: | + This helps in identifying the error by unique key. + message: + type: string + description: | + This explains what the error is in `human readable` text + project_in_only_id: + type: object + required: + - id + additionalProperties: false + properties: + id: + $ref: '#/components/schemas/id_integer' + project_delete_summary_out: + type: object + required: + - data + additionalProperties: false + properties: + data: + type: object + required: + - delete_count + - projects + properties: + delete_count: + type: integer + description: Count of projects that could be deleted from input projects. + example: 2 + projects: + type: array + description: Projects that could be deleted. + example: + - id: 1234 + - id: 4567 + items: + $ref: '#/components/schemas/project_in_only_id' + admin_cost_center_out: + type: object + additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - is_enabled + - code + - description + - restricted_spender_user_ids + properties: + id: + $ref: '#/components/schemas/id_integer' + name: + type: string + maxLength: 255 + description: | + This represents the name of the cost center. + example: sales & marketing + code: + $ref: '#/components/schemas/code' + description: + $ref: '#/components/schemas/description' + is_enabled: + $ref: '#/components/schemas/is_enabled' + org_id: + $ref: '#/components/schemas/org_id' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + restricted_spender_user_ids: + $ref: '#/components/schemas/restricted_spender_user_ids' + cost_center_in: + type: object + required: + - name + additionalProperties: false + properties: + id: + $ref: '#/components/schemas/id_integer' + name: + type: string + maxLength: 255 + description: | + This represents the name of the cost center. + example: sales & marketing + code: + $ref: '#/components/schemas/code' + description: + $ref: '#/components/schemas/description' + is_enabled: + $ref: '#/components/schemas/is_enabled' + restricted_spender_user_ids: + type: array + nullable: true + items: + type: string + nullable: false + maxLength: 15 + description: | + This id is provided by Sage Exp Mgmt to identify an object. + example: uswoirwlwwg + example: + - uswoirwlwwg + - uswlgwkgw42 + description: | + - List of IDs of users who can access this object. + - `null` value indicates that all users in the org can access this object. + - `[]` value indicates that no users in the org can access this object. + - **Note:** + - _Either `restricted_spender_user_ids` or `restricted_spender_user_group` key can be used to set restrictions. Both the keys can't be used together._ + - _While creating cost_centers, if both `restricted_spender_user_ids` and `restricted_spender_user_group` keys are not set, restrictions defaults to `"restricted_spender_user_group": {"with_no_cost_center_restrictions": "true"}`_ + - _While updating cost_centers, if both `restricted_spender_user_ids` and `restricted_spender_user_group` keys are not set, restrictions remains unchanged._ + restricted_spender_user_group: + type: object + required: + - with_no_cost_center_restrictions + additionalProperties: false + properties: + with_no_cost_center_restrictions: + type: boolean + description: | + - If you want the cost_center to be visible to all the users in the org with no cost center restrictions, + you can set this key to True.
+ **Note:** + - _Either `restricted_spender_user_ids` or `restricted_spender_user_group` key can be used to set restrictions. Both the keys can't be used together._ + - _While creating cost_centers, if both `restricted_spender_user_ids` and `restricted_spender_user_group` keys are not set, restrictions defaults to `"restricted_spender_user_group": {"with_no_cost_center_restrictions": "true"}`_ + - _While updating cost_centers, if both `restricted_spender_user_ids` and `restricted_spender_user_group` keys are not set, restrictions remains unchanged._ + example: true + cost_center_in_only_id: type: object required: - id @@ -13733,111 +16935,43 @@ components: properties: id: $ref: '#/components/schemas/id_integer' - project_delete_summary_out: + cost_center_delete_summary_out: type: object additionalProperties: false + required: + - data properties: data: type: object properties: delete_count: type: integer - description: Count of projects that could be deleted from input projects. + description: Count of cost centers that could be deleted from input cost centers. example: 2 - projects: + cost_centers: type: array - description: Projects that could be deleted. + description: Cost centers that could be deleted. example: - id: 1234 - id: 4567 items: - $ref: '#/components/schemas/project_in_only_id' - admin_cost_center_out: + $ref: '#/components/schemas/cost_center_in_only_id' + admin_approver_category_out: type: object additionalProperties: false - properties: - id: - $ref: '#/components/schemas/id_integer' - name: - type: string - maxLength: 255 - description: | - This represents the name of the cost center. - example: sales & marketing - code: - $ref: '#/components/schemas/code' - description: - $ref: '#/components/schemas/description' - is_enabled: - $ref: '#/components/schemas/is_enabled' - org_id: - $ref: '#/components/schemas/org_id' - created_at: - $ref: '#/components/schemas/created_at' - updated_at: - $ref: '#/components/schemas/updated_at' - restricted_spender_user_ids: - $ref: '#/components/schemas/restricted_spender_user_ids' - cost_center_in: - type: object required: + - created_at + - updated_at + - id + - org_id + - display_name + - code + - is_enabled - name - additionalProperties: false - properties: - id: - $ref: '#/components/schemas/id_integer' - name: - type: string - maxLength: 255 - description: | - This represents the name of the cost center. - example: sales & marketing - code: - $ref: '#/components/schemas/code' - description: - $ref: '#/components/schemas/description' - is_enabled: - $ref: '#/components/schemas/is_enabled' - restricted_spender_user_ids: - type: array - nullable: true - items: - type: string - nullable: false - maxLength: 15 - description: | - This id is provided by Sage Exp Mgmt to identify an object. - example: uswoirwlwwg - example: - - uswoirwlwwg - - uswlgwkgw42 - description: | - - List of IDs of users who can access this object. - - `null` value indicates that all users in the org can access this object. - - `[]` value indicates that no users in the org can access this object. - - **Note:** - - _Either `restricted_spender_user_ids` or `restricted_spender_user_group` key can be used to set restrictions. Both the keys can't be used together._ - - _While creating cost_centers, if both `restricted_spender_user_ids` and `restricted_spender_user_group` keys are not set, restrictions defaults to `"restricted_spender_user_group": {"with_no_cost_center_restrictions": "true"}`_ - - _While updating cost_centers, if both `restricted_spender_user_ids` and `restricted_spender_user_group` keys are not set, restrictions remains unchanged._ - restricted_spender_user_group: - type: object - required: - - with_no_cost_center_restrictions - additionalProperties: false - properties: - with_no_cost_center_restrictions: - type: boolean - description: | - - If you want the cost_center to be visible to all the users in the org with no cost center restrictions, - you can set this key to True.
- **Note:** - - _Either `restricted_spender_user_ids` or `restricted_spender_user_group` key can be used to set restrictions. Both the keys can't be used together._ - - _While creating cost_centers, if both `restricted_spender_user_ids` and `restricted_spender_user_group` keys are not set, restrictions defaults to `"restricted_spender_user_group": {"with_no_cost_center_restrictions": "true"}`_ - - _While updating cost_centers, if both `restricted_spender_user_ids` and `restricted_spender_user_group` keys are not set, restrictions remains unchanged._ - example: true - admin_approver_category_out: - type: object - additionalProperties: false + - sub_category + - system_category + - restricted_project_ids + - restricted_spender_user_ids properties: id: $ref: '#/components/schemas/id_integer' @@ -13952,10 +17086,15 @@ components: $ref: '#/components/schemas/id_integer' category_delete_summary_out: type: object + required: + - data additionalProperties: false properties: data: type: object + required: + - delete_count + - categories properties: delete_count: type: integer @@ -13972,6 +17111,8 @@ components: system_category_out: type: object additionalProperties: false + required: + - name properties: name: type: string @@ -13988,6 +17129,25 @@ components: expense_field_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - seq + - field_name + - column_name + - type + - options + - default_value + - placeholder + - category_ids + - is_enabled + - is_custom + - is_mandatory + - code + - parent_field_id + - display_order properties: id: $ref: '#/components/schemas/id_integer' @@ -14058,6 +17218,13 @@ components: description: | This specifies the `id` of the parent expense field and denotes that the expense field is a dependent custom field. NOTE: `type` must be `DEPENDENT_SELECT`. example: 1234 + display_order: + type: integer + nullable: true + readOnly: true + description: | + The 1-based position of an enabled, non-dependent custom expense field in the organization's custom order. + example: 1 expense_field_in: type: object additionalProperties: false @@ -14133,9 +17300,27 @@ components: description: | This specifies the `id` of the parent expense field and denotes that the expense field is a dependent custom field. NOTE: `type` must be `DEPENDENT_SELECT`. example: 1234 + expense_field_reorder_in: + type: object + additionalProperties: false + required: + - id + properties: + id: + $ref: '#/components/schemas/id_integer' dependent_expense_field_values_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - parent_expense_field_id + - expense_field_id + - parent_expense_field_value + - expense_field_value + - is_enabled properties: id: $ref: '#/components/schemas/id_integer' @@ -14209,6 +17394,12 @@ components: dependent_expense_field_values_preview_out: type: object additionalProperties: false + required: + - org_id + - parent_expense_field_id + - expense_field_id + - parent_expense_field_value + - expense_field_values properties: org_id: $ref: '#/components/schemas/org_id' @@ -14243,6 +17434,16 @@ components: dependent_expense_field_values_upload_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - parent_expense_field_id + - expense_field_id + - file_id + - error_file_id + - state properties: id: $ref: '#/components/schemas/id_integer' @@ -14309,6 +17510,15 @@ components: dependent_expense_field_values_download_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - parent_expense_field_id + - expense_field_id + - file_id + - state properties: id: $ref: '#/components/schemas/id_integer' @@ -14362,6 +17572,16 @@ components: employee_field_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - type + - options + - is_mandatory + - is_enabled properties: id: $ref: '#/components/schemas/id_integer' @@ -14459,6 +17679,17 @@ components: per_diem_rate_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - is_enabled + - name + - currency + - rate + - code + - description properties: id: $ref: '#/components/schemas/id_integer' @@ -14517,6 +17748,38 @@ components: type: number example: 10 description: Amount per night + per_diem_rate_in_only_id: + type: object + required: + - id + additionalProperties: false + properties: + id: + $ref: '#/components/schemas/id_integer' + per_diem_rate_delete_summary_out: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + required: + - delete_count + - per_diem_rates + properties: + delete_count: + type: integer + description: Count of per diem rates that could be deleted from input per diem rates. + example: 2 + per_diem_rates: + type: array + description: Per diem rates that could be deleted. + example: + - id: 1234 + - id: 4567 + items: + $ref: '#/components/schemas/per_diem_rate_in_only_id' department_head_user_ids: type: array nullable: false @@ -14535,6 +17798,20 @@ components: department_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - sub_department + - is_enabled + - code + - description + - department_head_user_ids + - doc_url + - department_head_users + - display_name properties: id: $ref: '#/components/schemas/id_string' @@ -14608,9 +17885,55 @@ components: description: | Link to an external document that would be shared with employees example: https://stoplight.io/ + department_in_only_id: + type: object + required: + - id + additionalProperties: false + properties: + id: + $ref: '#/components/schemas/id_string' + department_delete_summary_out: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + additionalProperties: false + properties: + delete_count: + type: integer + description: Count of departments that can be deleted from the supplied departments. + example: 2 + departments: + type: array + description: Departments that can be deleted. + example: + - id: deptTqSvgYSlMk + - id: deptISw67iupk3 + items: + $ref: '#/components/schemas/department_in_only_id' mileage_rate_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - unit + - vehicle_type + - rate + - slab_rates + - is_enabled + - code + - vehicle_ownership + - vehicle_category + - fuel_type + - engine_capacity + - charging_location properties: id: $ref: '#/components/schemas/id_integer' @@ -14637,6 +17960,9 @@ components: type: array items: type: object + required: + - rate + - limit properties: rate: type: number @@ -14648,6 +17974,58 @@ components: $ref: '#/components/schemas/is_enabled' code: $ref: '#/components/schemas/code' + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Vehicle ownership for advanced mileage rates. `null` for basic mileage rates. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Vehicle category for advanced mileage rates. `null` for basic mileage rates. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Fuel type for advanced car mileage rates. `null` otherwise. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Engine capacity band for petrol, diesel, and LPG advanced car rates. An empty object for basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Charging location for advanced electric car mileage rates. `null` otherwise. mileage_rate_in: type: object required: @@ -14655,6 +18033,11 @@ components: - rate - vehicle_type - is_enabled + - vehicle_ownership + - vehicle_category + - fuel_type + - engine_capacity + - charging_location properties: id: $ref: '#/components/schemas/id_integer' @@ -14669,10 +18052,12 @@ components: rate: type: number example: 10 - nullable: true + minimum: 0 + exclusiveMinimum: true description: Amount (in Home currency) per unit. slab_rates: type: array + maxItems: 1 items: type: object required: @@ -14681,14 +18066,96 @@ components: properties: rate: type: number - nullable: true limit: type: number - nullable: true is_enabled: $ref: '#/components/schemas/is_enabled' code: $ref: '#/components/schemas/code' + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Optional. Use `null` for a basic mileage rate; an advanced rate requires a non-null value. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Optional. Use `null` for a basic mileage rate; an advanced rate requires a non-null value. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Optional. Use `null` for motorcycles, bicycles, and basic mileage rates. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Optional. Use an empty object for electric and basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Optional. Use `null` unless the rate is an advanced electric car. + mileage_rate_in_only_id: + type: object + required: + - id + additionalProperties: false + properties: + id: + $ref: '#/components/schemas/id_integer' + mileage_rate_delete_summary_out: + type: object + required: + - data + additionalProperties: false + properties: + data: + type: object + required: + - delete_count + - mileage_rates + properties: + delete_count: + type: integer + description: Count of mileage rates that could be deleted from input mileage rates. + example: 2 + mileage_rates: + type: array + description: Mileage rates that could be deleted. + example: + - id: 9080 + - id: 9081 + items: + $ref: '#/components/schemas/mileage_rate_in_only_id' level_out: type: object additionalProperties: false @@ -14761,6 +18228,36 @@ components: required: - name - is_enabled + level_in_only_id: + type: object + required: + - id + additionalProperties: false + properties: + id: + $ref: '#/components/schemas/id_string' + level_delete_summary_out: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + additionalProperties: false + properties: + delete_count: + type: integer + description: Count of levels that can be deleted from the supplied levels. + example: 2 + levels: + type: array + description: Levels that can be deleted. + example: + - id: lvlTqSvgYSlMk + - id: lvlISw67iupk3 + items: + $ref: '#/components/schemas/level_in_only_id' fk_string: type: string nullable: true @@ -14768,10 +18265,15 @@ components: description: | This id is provided by Sage Exp Mgmt to identify an object. example: sdfd2391 - department_out_embed: + department_out_employee_embed: type: object additionalProperties: false nullable: true + required: + - id + - code + - name + - sub_department properties: id: $ref: '#/components/schemas/id_string' @@ -14785,11 +18287,6 @@ components: type: string nullable: true example: Outbound Sales - display_name: - type: string - example: Sales / Outbound Sales - description: | - This is a combination of name and sub_department separated by a / and spaces. In case if no sub_department is present it is same as name of the department. null_field: type: string nullable: true @@ -14947,6 +18444,12 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - sub_project + - code + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -14973,6 +18476,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -14988,6 +18495,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -15001,6 +18512,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - vehicle_type + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -15091,9 +18606,30 @@ components: description: | String denoting the full name of an employee. example: Jon Snow + delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: + - SUBMIT + - APPROVE delegatees: type: object additionalProperties: false + required: + - id + - type + - user_id + - email + - full_name + - start_at + - scopes properties: id: allOf: @@ -15133,10 +18669,21 @@ components: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true + scopes: + allOf: + - $ref: '#/components/schemas/delegation_access_scope' + nullable: true category_out_embed: type: object nullable: true additionalProperties: false + required: + - id + - system_category + - name + - sub_category + - code + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -15167,6 +18714,48 @@ components: employee_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - business_unit + - code + - custom_fields + - department + - department_id + - is_enabled + - joined_at + - level + - level_id + - location + - org_id + - roles + - special_email + - title + - user_id + - user + - mileage_rate_ids + - mileage_rates + - cost_center_ids + - cost_centers + - per_diem_rate_ids + - per_diem_rates + - project_ids + - projects + - approver_user_ids + - approver_users + - has_accepted_invite + - branch_account + - branch_ifsc + - mobile + - locale + - mileage_settings + - ach_account + - delegatees + - category_ids + - categories + - flattened_custom_field + - is_mobile_verified properties: id: $ref: '#/components/schemas/id_string' @@ -15196,7 +18785,7 @@ components: department_id: $ref: '#/components/schemas/fk_string' department: - $ref: '#/components/schemas/department_out_embed' + $ref: '#/components/schemas/department_out_employee_embed' is_enabled: allOf: - $ref: '#/components/schemas/is_enabled' @@ -15413,6 +19002,9 @@ components: additionalProperties: false items: type: object + required: + - role + - count additionalProperties: false properties: role: @@ -15424,6 +19016,8 @@ components: expense_duplicate_sets_out: type: object additionalProperties: false + required: + - expense_ids properties: expense_ids: type: array @@ -15438,6 +19032,11 @@ components: employee_out_potential_duplicate_expenses: type: object additionalProperties: false + required: + - user_id + - email + - full_name + - potential_duplicate_expenses properties: user_id: $ref: '#/components/schemas/user_id' @@ -15455,6 +19054,9 @@ components: $ref: '#/components/schemas/expense_duplicate_sets_out' employees_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -15504,6 +19106,8 @@ components: default: true separate_line_items_entry: type: object + required: + - enabled properties: enabled: type: boolean @@ -15575,6 +19179,20 @@ components: Configuration for the export. employees_exports_out: type: object + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - notify_emails + - config + - file_id + - state + - processed_at + - completed_at + - failed_at properties: created_at: type: string @@ -15644,6 +19262,11 @@ components: delegatee: type: object additionalProperties: false + required: + - user_id + - start_at + - end_at + - scopes properties: user_id: type: string @@ -15662,6 +19285,10 @@ components: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true + scopes: + allOf: + - $ref: '#/components/schemas/delegation_access_scope' + nullable: true invitation_in: type: object additionalProperties: false @@ -15712,12 +19339,24 @@ components: example: Branch Manager custom_fields: $ref: '#/components/schemas/custom_fields' + roles: + type: array + nullable: false + items: + $ref: '#/components/schemas/role' + example: + - FYLER + - APPROVER + description: | + List of roles for this employee approver_emails: type: array maxItems: 3 nullable: false items: - $ref: '#/components/schemas/email' + anyOf: + - $ref: '#/components/schemas/email' + - $ref: '#/components/schemas/null_field' example: - approver1@example.com - approver2@example.com @@ -15858,6 +19497,15 @@ components: employee_filters_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - name + - is_shared + - query_string properties: id: allOf: @@ -15903,6 +19551,15 @@ components: employees_upload_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - user_id + - org_id + - file_id + - error_file_id + - state properties: id: allOf: @@ -15947,6 +19604,13 @@ components: employees_download_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - file_id + - state properties: id: allOf: @@ -15977,6 +19641,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - email + - full_name properties: id: allOf: @@ -15993,6 +19661,20 @@ components: employee_summary_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - user + - approver_users + - unreported_expenses_total + - unapproved_reports_total + - reimbursable_amount + - advance_account_ids + - advance_accounts_balance + - liability_amount properties: id: $ref: '#/components/schemas/id_string' @@ -16050,6 +19732,8 @@ components: Total liability payable to the employee. employees_export_configuration_separate_line_items_entry: type: object + required: + - is_enabled properties: is_enabled: type: boolean @@ -16071,6 +19755,10 @@ components: Configure which columns to show for credit entries only. example: [] employees_export_configuration_column: + required: + - name + - formula + - is_custom type: object properties: name: @@ -16108,6 +19796,10 @@ components: example: GET(department, name) employees_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -16129,6 +19821,11 @@ components: example: desc employees_export_configuration_config: type: object + required: + - is_header_visible + - separate_line_items_entry + - columns + - date_format additionalProperties: true properties: is_header_visible: @@ -16162,6 +19859,17 @@ components: employees_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -16177,16 +19885,6 @@ components: $ref: '#/components/schemas/created_at' updated_at: $ref: '#/components/schemas/updated_at' - created_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | @@ -16258,9 +19956,9 @@ components: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature employees_export_configuration_in_only_id: type: object required: @@ -16309,6 +20007,17 @@ components: file_out: type: object additionalProperties: false + required: + - id + - org_id + - user_id + - created_at + - updated_at + - name + - type + - content_type + - download_url + - upload_url properties: id: $ref: '#/components/schemas/id_string' @@ -16348,12 +20057,20 @@ components: Returns null if linked to an expense or advance request in approved or higher state. file_generate_urls_action_in: type: object + required: + - id properties: id: $ref: '#/components/schemas/id_string' file_generate_urls_action_out: type: object additionalProperties: false + required: + - id + - name + - content_type + - download_url + - upload_url properties: id: $ref: '#/components/schemas/id_string' @@ -16385,6 +20102,9 @@ components: schedule_config: type: object nullable: false + required: + - type + - when properties: type: nullable: false @@ -16522,6 +20242,17 @@ components: accounting_export_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - file_ids + - exported_at + - description + - url + - client_id properties: id: allOf: @@ -16596,6 +20327,15 @@ components: accounting_export_lineitem_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - object_id + - object_type + - reference + - accounting_export_id properties: id: $ref: '#/components/schemas/id_string' @@ -16681,6 +20421,9 @@ components: example: 1234 account_out_embed: type: object + required: + - id + - type properties: id: allOf: @@ -16700,6 +20443,11 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - vehicle_type + - code + - rate properties: id: $ref: '#/components/schemas/id_integer' @@ -16713,6 +20461,58 @@ components: example: 10 nullable: true description: Amount (in Home currency) per unit. + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Vehicle ownership for advanced mileage rates. `null` for basic mileage rates. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Vehicle category for advanced mileage rates. `null` for basic mileage rates. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Fuel type for advanced car mileage rates. `null` otherwise. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Engine capacity band for petrol, diesel, and LPG advanced car rates. An empty object for basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Charging location for advanced electric car mileage rates. `null` otherwise. expense_custom_field: type: object description: | @@ -16780,13 +20580,34 @@ components: report_approval_out_embed: type: object additionalProperties: false + required: + - approver_user_id + - approver_user + - state properties: approver_user_id: allOf: - $ref: '#/components/schemas/id_string' + nullable: true + description: | + The user ID of the approver. This is null when approver_type is SYSTEM (auto-approval). example: usge49ielgel + approver_type: + type: string + enum: + - USER + - SYSTEM + description: | + Type of approver. + - USER: A human approver identified by approver_user_id + - SYSTEM: Automatic approval by the system (auto-approval feature). When approver_type is SYSTEM, approver_user_id is null. + example: USER approver_user: - $ref: '#/components/schemas/user_out_embed' + allOf: + - $ref: '#/components/schemas/user_out_embed' + nullable: true + description: | + The user object of the approver. This is null when approver_type is SYSTEM. state: type: string enum: @@ -16815,6 +20636,9 @@ components: - last_paid_at - reimbursement_id - reimbursement_seq_num + - amount + - last_verified_at + - approvals properties: id: anyOf: @@ -16903,6 +20727,11 @@ components: List of report_approval objects file_out_embed: type: object + required: + - id + - name + - type + - content_type properties: id: allOf: @@ -16938,6 +20767,9 @@ components: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string @@ -16945,6 +20777,9 @@ components: expense_verification_out_embed: type: object additionalProperties: false + required: + - verifier_user_id + - verifier_user properties: verifier_user_id: allOf: @@ -16963,10 +20798,51 @@ components: maxLength: 255 nullable: true example: dept9in4oIHpdR + department_out_embed: + type: object + additionalProperties: false + nullable: true + required: + - id + - code + - name + - sub_department + - display_name + properties: + id: + $ref: '#/components/schemas/id_string' + code: + $ref: '#/components/schemas/code' + name: + allOf: + - $ref: '#/components/schemas/name' + example: Sales + sub_department: + type: string + nullable: true + example: Outbound Sales + display_name: + type: string + example: Sales / Outbound Sales + description: | + This is a combination of name and sub_department separated by a / and spaces. In case if no sub_department is present it is same as name of the department. employee_out_embed_for_expense: type: object additionalProperties: false nullable: true + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department + - location + - title + - business_unit + - custom_fields + - flattened_custom_field properties: id: $ref: '#/components/schemas/id_string' @@ -17068,6 +20944,21 @@ components: - id - corporate_card_id - corporate_card_number + - corporate_card_nickname + - masked_corporate_card_number + - bank_name + - corporate_card_user_full_name + - amount + - currency + - spent_at + - posted_at + - status + - description + - foreign_currency + - foreign_amount + - merchant + - category + - matched_by properties: id: allOf: @@ -17112,6 +21003,11 @@ components: description: | String denoting the card holder's full name example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false amount: $ref: '#/components/schemas/amount' currency: @@ -17174,6 +21070,128 @@ components: description: | String denoting the email of the user who matched the card transaction to an expense. example: john.ooe@sage.com + matched_corporate_card_transaction_out_embed_new: + anyOf: + - type: object + additionalProperties: false + properties: {} + description: Empty object when no corporate card transaction is matched + - type: object + required: + - id + - corporate_card_id + - corporate_card_number + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: btxnwownwrng + corporate_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + corporate_card_number: + $ref: '#/components/schemas/card_number' + corporate_card_nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: Business Card + corporate_card_cardholder_name: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the card holder's name + example: John Cena + capitalone_virtual_card_last_four: + type: string + nullable: true + description: | + Last four digits of capitalone virtual card. + example: '4521' + masked_corporate_card_number: + $ref: '#/components/schemas/card_number' + bank_name: + nullable: true + $ref: '#/components/schemas/bank_name' + corporate_card_user_full_name: + nullable: true + allOf: + - $ref: '#/components/schemas/name_nullable' + maxLength: 255 + description: | + String denoting the card holder's full name + example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false + amount: + $ref: '#/components/schemas/amount' + currency: + $ref: '#/components/schemas/currency' + spent_at: + allOf: + - $ref: '#/components/schemas/spent_at' + description: | + Signifies spent date of a card transaction. + This date cannot be in future. + posted_at: + nullable: true + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies post date of a card transaction. + This date cannot be in future. + status: + type: string + nullable: true + enum: + - PENDING + - POSTED + - null + example: PENDING + description: | + Signifies status of a card transaction. + description: + type: string + nullable: true + description: | + Holds the description of the card transaction + example: Team lunch + foreign_currency: + nullable: true + allOf: + - $ref: '#/components/schemas/foreign_currency' + foreign_amount: + nullable: true + allOf: + - $ref: '#/components/schemas/foreign_amount' + merchant: + nullable: true + allOf: + - $ref: '#/components/schemas/merchant' + description: | + String denoting the name of the vendor to which the card transaction was made. + Note: This is not same as the merchant added in Sage Exp Mgmt but just a string + category: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the category of the card transaction + Note: This is not same as the category added in Sage Exp Mgmt but just a string + example: Travel + matched_by: + type: string + nullable: true + description: | + String denoting the email of the user who matched the card transaction to an expense. + example: john.ooe@sage.com missing_mandatory_fields: type: object nullable: false @@ -17425,6 +21443,12 @@ components: example: 77.594566 commute_details: type: object + required: + - id + - distance + - distance_unit + - home_location + - work_location nullable: true description: | Commute details of the employee. This is used to deduct daily commute from the employee's mileage expenses. @@ -17493,12 +21517,18 @@ components: - source_account - tax_amount - tax_group_id + - calculated_tax_amount - is_billable - is_reimbursable - distance - distance_unit - mileage_calculated_distance - mileage_calculated_amount + - selected_vehicle_ownership + - selected_vehicle_category + - passenger_count + - passenger_mileage_rate + - passenger_amount - mileage_rate_id - mileage_rate - mileage_is_round_trip @@ -17517,6 +21547,7 @@ components: - seq_num - report_id - added_to_report_at + - added_to_report_by - report - is_verified - last_verified_at @@ -17529,6 +21560,8 @@ components: - is_corporate_card_transaction_auto_matched - matched_corporate_card_transaction_ids - matched_corporate_card_transactions + - matched_corporate_card_transaction_id + - matched_corporate_card_transaction - last_settled_at - missing_mandatory_fields - activity_details @@ -17542,6 +21575,26 @@ components: - invoice_number - is_duplicate_present - expense_policy_comments + - custom_fields_flattened + - approvals + - verifications + - employee_id + - split_group_amount + - expense_rule_id + - expense_rule_data + - is_split + - tax_group + - approver_comments + - verifier_comments + - policy_checks + - accounting_export_summary + - report_last_paid_at + - report_last_approved_at + - commute_deduction + - commute_details_id + - commute_details + - is_reconciled + - report_auto_approval_state properties: id: allOf: @@ -17664,6 +21717,12 @@ components: allOf: - $ref: '#/components/schemas/fk_string' nullable: true + calculated_tax_amount: + type: number + nullable: true + readOnly: true + description: | + System-derived tax amount for the expense amount and the selected tax group's rate. is_billable: type: boolean nullable: true @@ -17694,6 +21753,36 @@ components: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + selected_vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Selected vehicle ownership for an advanced mileage expense. `null` for a basic mileage expense. + selected_vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Selected vehicle category for an advanced mileage expense. `null` for a basic mileage expense. + passenger_count: + type: integer + nullable: true + description: Number of passengers carried on the mileage journey. + passenger_mileage_rate: + type: number + nullable: true + readOnly: true + description: Passenger mileage rate snapshot applied to this expense. `null` when passenger mileage does not apply. + passenger_amount: + type: number + nullable: true + description: Passenger mileage reimbursement amount for this expense. mileage_rate_id: allOf: - $ref: '#/components/schemas/fk_integer' @@ -17797,6 +21886,16 @@ components: description: | signifies when this expense was added to a report. If this expense is not added to a report, then this could be null. + added_to_report_by: + type: string + nullable: true + enum: + - USER + - SYSTEM + - null + description: | + Indicates whether the expense was added to the report it belongs to by a user or the system. If the expense is not a part of any report, this field will be null. + example: USER report: $ref: '#/components/schemas/report_out_embed' is_verified: @@ -17869,6 +21968,8 @@ components: $ref: '#/components/schemas/id_string' description: | Holds the corporate card transaction ids which are matched to this expense + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction_id` instead, as this array always contains a single value. example: - btxnwownwrng matched_corporate_card_transactions: @@ -17878,6 +21979,20 @@ components: description: | Holds the corporate card transactions which are matched to this expense. NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_ids` is already up-to-date. + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction` instead, as this array always contains a single value. + matched_corporate_card_transaction_id: + type: string + nullable: true + description: | + Holds the corporate card transaction id which is matched to this expense + example: btxnwownwrng + matched_corporate_card_transaction: + allOf: + - $ref: '#/components/schemas/matched_corporate_card_transaction_out_embed_new' + description: | + Holds the corporate card transaction which is matched to this expense. + NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_id` is already up-to-date. last_settled_at: allOf: - $ref: '#/components/schemas/timestamptz_utc' @@ -18046,6 +22161,15 @@ components: description: | Whether expenses is reconciled or not. example: true + report_auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the expense's report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null source: type: string description: | @@ -18143,7 +22267,7 @@ components: The expense amount which is added or modified by admin or approver. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: 1900 spent_at: type: string @@ -18154,7 +22278,7 @@ components: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' assignee_user_email: allOf: @@ -18164,9 +22288,9 @@ components: Must be compliant with RFC 822. - **Note:** - - The expense will be assigned/re-assigned to this particular `employee`. + - The expense will be assigned/re-assigned to this particular `employee`. - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. - Admins can't assign the expense to self. source: $ref: '#/components/schemas/source' @@ -18268,6 +22392,16 @@ components: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. commute_details_id: type: integer nullable: true @@ -18302,6 +22436,110 @@ components: description: | Specific to per diem related expenses, number of days for which per diem claim is made.
This field is required for creating Per Diem Expenses. + items: + type: object + required: + - id + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + description: | + Expense id of the expense to be updated. + example: txwownwrng + merchant: + $ref: '#/components/schemas/merchant' + nullable: true + description: | + String denoting the name of the merchant to which the expense was made. + example: Uber + purpose: + type: string + nullable: true + description: | + Purpose of this expense. + example: Team lunch + cost_center_id: + allOf: + - $ref: '#/components/schemas/fk_integer' + nullable: true + description: | + This represents the cost_center's id given by Sage Exp Mgmt during creation of cost center + for which this expense is created. + example: 1049 + category_id: + allOf: + - $ref: '#/components/schemas/fk_integer' + nullable: false + description: | + This represents the category's id given by Sage Exp Mgmt during creation of category + for which this expense is created. + example: 49058 + project_id: + allOf: + - $ref: '#/components/schemas/fk_integer' + nullable: true + description: | + This represents the project's id given by Sage Exp Mgmt during creation of project + for which this expense is created. + example: 92895 + is_billable: + $ref: '#/components/schemas/is_billable' + nullable: true + description: This fields marks whether a given expense is billable or not. + example: true + custom_fields: + $ref: '#/components/schemas/custom_fields' + nullable: false + started_at: + $ref: '#/components/schemas/timestamptz_pst' + nullable: true + description: | + Start date for travel or per diem related expenses. + ended_at: + $ref: '#/components/schemas/timestamptz_pst' + nullable: true + description: | + End date for travel or per diem related expenses. + travel_classes: + $ref: '#/components/schemas/travel_classes' + nullable: false + description: | + This field is applicable only for `Flight`, `Train`, `Bus`, `Taxi` category. + index 0 holds onward journey class, index 1 holds return journey travel class. + example: + - ECONOMY + - BUSINESS + locations: + $ref: '#/components/schemas/locations' + nullable: false + description: | + This field will be present for travel related categories. + For travel between Place A to Place B, this array will contain two items, From location at array index 0 and To location at array index 1. + distance: + $ref: '#/components/schemas/distance' + nullable: true + description: Actual distance travelled by employee in travel related expenses. + distance_unit: + enum: + - KM + - MILES + - null + nullable: true + description: Unit of distance travelled. + example: MILES + hotel_is_breakfast_provided: + type: boolean + nullable: true + description: | + This field is applicable for only `Hotel` category. + admin_expenses_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be updated in bulk by the admin. + items: + $ref: '#/components/schemas/items' attach_files_to_expense_in: type: object required: @@ -18361,6 +22599,16 @@ components: expense_filters_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - name + - is_shared + - query_string + - sub_feature properties: id: allOf: @@ -18419,6 +22667,8 @@ components: Expense ID of the expense to be verified. example: tx0agOdICdbV expenses_stats_in: + required: + - query_params properties: query_params: nullable: false @@ -18502,6 +22752,18 @@ components: - state: UNREPORTABLE count: 0 total_amount: 0 + expenses_count_out: + type: object + additionalProperties: false + required: + - count + properties: + count: + type: integer + minimum: 0 + nullable: false + description: Number of expenses matching the requested state and enabled-employee criteria. + example: 33 query_params: type: string description: | @@ -18509,6 +22771,9 @@ components: example: state=eq.PAID expenses_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -18619,6 +22884,17 @@ components: expenses_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - notify_emails + - config + - file_id + - state properties: created_at: $ref: '#/components/schemas/created_at' @@ -18721,6 +22997,10 @@ components: example: GET(merchant) expenses_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -18744,7 +23024,7 @@ components: type: object additionalProperties: true properties: - is_column_header_included: + is_header_visible: type: boolean description: | Whether to include column headers in the export file. Required for CSV and EXCEL export types. @@ -18780,6 +23060,17 @@ components: expenses_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -18795,16 +23086,6 @@ components: $ref: '#/components/schemas/created_at' updated_at: $ref: '#/components/schemas/updated_at' - created_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | @@ -18878,9 +23159,9 @@ components: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature expenses_export_configuration_in_only_id: type: object required: @@ -19092,6 +23373,12 @@ components: advance_out_embed: type: object nullable: true + required: + - id + - currency + - amount + - advance_request_id + - seq_num properties: id: type: string @@ -19120,6 +23407,11 @@ components: type: object description: | Advance request custom field + required: + - id + - name + - type + - value properties: name: type: string @@ -19167,6 +23459,10 @@ components: advance_request_approval_out_embed: type: object additionalProperties: false + required: + - approver_user_id + - approver_user + - state properties: approver_user_id: allOf: @@ -19186,6 +23482,14 @@ components: employee_out_embed: type: object additionalProperties: false + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department properties: id: $ref: '#/components/schemas/id_string' @@ -19208,7 +23512,7 @@ components: $ref: '#/components/schemas/department_id' department: nullable: true - $ref: '#/components/schemas/department_out_embed' + $ref: '#/components/schemas/department_out_employee_embed' user_id_nullable: type: string description: | @@ -19216,9 +23520,16 @@ components: readOnly: true nullable: true example: uswjwgnwwgo - advance_request_comments_out: + advance_request_comments_out_embed: type: object additionalProperties: false + required: + - id + - comment + - creator_type + - creator_user_id + - creator_user + - created_at properties: id: $ref: '#/components/schemas/id_string' @@ -19226,12 +23537,6 @@ components: type: string description: A comment on the advance request example: Advance request was created - action: - type: string - description: Advance request action for which comment is added. - example: SUBMITTED - advance_request_id: - $ref: '#/components/schemas/id_string' creator_type: type: string description: Describes whether the comment is system-generated or User made. @@ -19246,13 +23551,37 @@ components: $ref: '#/components/schemas/user_out_embed_nullable' created_at: $ref: '#/components/schemas/created_at' - updated_at: - $ref: '#/components/schemas/updated_at' - org_id: - $ref: '#/components/schemas/org_id' advance_request_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - user_id + - org_id + - project_id + - advance_id + - seq_num + - currency + - amount + - last_approved_at + - notes + - purpose + - source + - state + - custom_fields + - user + - project + - advance + - approvals + - is_exported + - employee_id + - employee + - code + - comments + - file_ids + - files properties: id: allOf: @@ -19351,7 +23680,7 @@ components: comments: type: array items: - $ref: '#/components/schemas/advance_request_comments_out' + $ref: '#/components/schemas/advance_request_comments_out_embed' description: | List of comments in the advance request file_ids: @@ -19364,7 +23693,7 @@ components: type: array items: $ref: '#/components/schemas/file_out_embed' - advance_request_in: + advance_request_in_base: type: object properties: id: @@ -19402,7 +23731,15 @@ components: $ref: '#/components/schemas/fk_integer' custom_fields: $ref: '#/components/schemas/advance_request_custom_fields' + admin_advance_request_in: + allOf: + - $ref: '#/components/schemas/advance_request_in_base' + - type: object + required: + - id advance_requests_stats_in: + required: + - query_params properties: query_params: description: | @@ -19498,6 +23835,18 @@ components: advance_request_permissions_out: type: object additionalProperties: false + required: + - can_save + - can_submit + - can_edit + - can_add_approver + - can_disable_approver + - can_reject + - can_approve + - can_inquire + - can_pull_back + - can_pay + - can_delete properties: can_save: type: boolean @@ -19558,6 +23907,51 @@ components: type: string description: Comment text to be added to the advance request example: test + advance_request_comments_out: + type: object + additionalProperties: false + required: + - id + - comment + - action + - advance_request_id + - creator_type + - creator_user_id + - creator_user + - created_at + - updated_at + - org_id + properties: + id: + $ref: '#/components/schemas/id_string' + comment: + type: string + description: A comment on the advance request + example: Advance request was created + action: + type: string + description: Advance request action for which comment is added. + example: SUBMITTED + advance_request_id: + $ref: '#/components/schemas/id_string' + creator_type: + type: string + description: Describes whether the comment is system-generated or User made. + enum: + - SYSTEM + - POLICY + - USER + example: USER + creator_user_id: + $ref: '#/components/schemas/user_id_nullable' + creator_user: + $ref: '#/components/schemas/user_out_embed_nullable' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + org_id: + $ref: '#/components/schemas/org_id' advance_request_remove_approver_in: type: object additionalProperties: false @@ -19576,6 +23970,10 @@ components: advance_request_out_embed: type: object nullable: true + required: + - id + - last_approved_at + - seq_num properties: id: type: string @@ -19600,6 +23998,36 @@ components: advance_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - advance_request_id + - user_id + - org_id + - project_id + - seq_num + - amount + - issued_at + - card_number + - currency + - custom_fields + - foreign_amount + - foreign_currency + - payment_mode + - purpose + - code + - source + - advance_account_id + - advance_wallet_id + - is_exported + - last_exported_at + - user + - project + - employee_id + - employee + - creator_user + - advance_request properties: id: allOf: @@ -19712,6 +24140,14 @@ components: - currency - amount - payment_mode + - advance_request_id + - project_id + - card_number + - custom_fields + - foreign_amount + - foreign_currency + - purpose + - code properties: user_id: type: string @@ -19776,6 +24212,8 @@ components: custom_fields: $ref: '#/components/schemas/custom_fields' advances_stats_in: + required: + - query_params properties: query_params: type: string @@ -19785,6 +24223,9 @@ components: example: id=in.('adv1263', 'adv1569') advances_stats_out: type: object + required: + - count + - total_amount properties: count: type: integer @@ -19801,6 +24242,14 @@ components: advance_wallet_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - currency + - balance_amount properties: id: allOf: @@ -19831,6 +24280,26 @@ components: advance_refund_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - collector_user_id + - refunded_at + - currency + - amount + - foreign_currency + - foreign_amount + - payment_mode + - code + - notes + - source + - card_number + - advance_wallet_id + - employee_id + - employee properties: created_at: $ref: '#/components/schemas/created_at' @@ -19961,6 +24430,8 @@ components: - $ref: '#/components/schemas/id_string' example: awfgRr8YA6KK advance_refunds_stats_in: + required: + - query_params properties: query_params: type: string @@ -19970,6 +24441,9 @@ components: example: id=in.('adr1263', 'adr1569') advance_refunds_stats_out: type: object + required: + - count + - total_amount properties: count: type: integer @@ -20060,6 +24534,14 @@ components: pattern: ^[1-7](?:,[1-7])*$ example: 1,3,5 description: comma-separated day numbers (e.g. "1,3,5" for mon,wed,fri) + week: + oneOf: + - type: number + example: 2 + description: Week of the month (number, e.g. 2) + - type: string + example: '*/1' + description: cron expression (e.g. '*/1' for every week, '*/2' for every alternate week) hour: type: number example: 22 @@ -20085,6 +24567,19 @@ components: reminder_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - type + - message + - schedule_config + - add_to_calendar + - receiver_user_ids + - send_mobile_notification + - last_reminded_at + - next_reminder_at properties: id: type: string @@ -20126,11 +24621,24 @@ components: description: | Determines whether this reminder will be added as an event in the google calendar of receiver. example: true + send_mobile_notification: + type: boolean + nullable: false + default: false + description: | + Determines whether this reminder will be used to send mobile notification + example: true receiver_user_ids: $ref: '#/components/schemas/reminder_receiver_user_ids' reminder_in: type: object additionalProperties: false + required: + - type + - message + - schedule_config + - add_to_calendar + - receiver_user_ids properties: id: type: string @@ -20154,6 +24662,13 @@ components: description: | Determines whether this reminder will be added as an event in the google calendar of receiver. example: true + send_mobile_notification: + type: boolean + nullable: false + default: false + description: | + Determines whether this reminder will be used to send mobile notification + example: true receiver_user_ids: $ref: '#/components/schemas/reminder_receiver_user_ids' reminder_delete_in: @@ -20168,6 +24683,8 @@ components: ID of the reminder that needs to be deleted. example: remindNZgN7V5pft reminders_stats_in: + required: + - query_params properties: query_params: type: string @@ -20179,6 +24696,9 @@ components: type: array items: type: object + required: + - last_reminded_at + - type properties: last_reminded_at: type: string @@ -20191,6 +24711,18 @@ components: employee_out_embed_for_report: type: object additionalProperties: false + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department + - ach_account + - business_unit + - location + - title properties: id: $ref: '#/components/schemas/id_string' @@ -20334,6 +24866,12 @@ components: reimbursement_out_minimal: type: object nullable: true + required: + - id + - currency + - amount + - mode + - ach_transfer properties: id: type: string @@ -20386,6 +24924,9 @@ components: advance_wallet_report_out: type: object additionalProperties: false + required: + - id + - amount properties: id: allOf: @@ -20425,6 +24966,15 @@ components: - comments - applied_advance_wallets - can_apply_advances + - creator_type + - is_verified + - is_physical_bill_submitted + - physical_bill_submitted_at + - is_exported + - employee_id + - state_display_name + - accounting_export_summary + - auto_approval_state properties: id: $ref: '#/components/schemas/id_string' @@ -20629,6 +25179,23 @@ components: nullable: true description: | List of applied advance wallets + creator_type: + type: string + enum: + - USER + - SYSTEM + description: | + Indicates whether the report was created by a user or the system. + example: USER + auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null admin_report_in: type: object additionalProperties: false @@ -20665,6 +25232,16 @@ components: report_filters_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - is_shared + - name + - org_id + - query_string + - user_id + - sub_feature properties: id: allOf: @@ -20811,6 +25388,24 @@ components: description: | Specify why you are sending back the report. example: Amount is incorrect + revert_to_processing_in: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: rp13tP1HVeqa + required: + - id + revert_to_approved_in: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: rp13tP1HVeqa + required: + - id process_ach_in: type: object properties: @@ -20857,6 +25452,20 @@ components: - id process_summary_out: type: object + required: + - selected_reimbursable_amount + - selected_count + - unverified_count + - unverified_amount + - missing_bank_details_count + - missing_bank_details_amount + - missing_bank_details_employee_count + - missing_bank_details_employee_ids + - payment_initiated_amount + - payment_initiated_count + - reimbursable_amount + - reimbursable_report_ids + - closable_report_ids additionalProperties: true properties: selected_reimbursable_amount: @@ -20949,6 +25558,8 @@ components: id: $ref: '#/components/schemas/id_string' reports_stats_in: + required: + - query_params properties: query_params: type: string @@ -21107,6 +25718,17 @@ components: example: - txelntgwgwll - txavbdabass + report_action_resubmit: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: | + id of report, which needs to be resubmitted + example: rpa21A2rdj2 report_permissions_in: type: object additionalProperties: false @@ -21203,6 +25825,9 @@ components: $ref: '#/components/schemas/id_string' reports_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -21228,6 +25853,8 @@ components: reports_export_config: type: object additionalProperties: true + required: + - type properties: type: type: string @@ -21250,6 +25877,10 @@ components: example: true separate_line_items_entry: type: object + required: + - enabled + - debit_entries_only + - credit_entries_only properties: enabled: type: boolean @@ -21278,6 +25909,9 @@ components: type: array items: type: object + required: + - name + - formula properties: name: type: string @@ -21294,6 +25928,17 @@ components: reports_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - file_id + - state + - query_params + - notify_emails + - config properties: created_at: $ref: '#/components/schemas/created_at' @@ -21421,6 +26066,10 @@ components: example: GET(employee, user, full_name) reports_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -21475,6 +26124,17 @@ components: reports_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -21490,16 +26150,6 @@ components: $ref: '#/components/schemas/created_at' updated_at: $ref: '#/components/schemas/updated_at' - created_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | @@ -21573,9 +26223,9 @@ components: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature reports_export_configuration_in_only_id: type: object required: @@ -21730,6 +26380,23 @@ components: description: | Unique nickname assigned to the card example: Business Card + is_archived: + type: boolean + description: | + Indicates whether the corporate card is archived. + nullable: false + archived_at: + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies when the card was archived + example: '2022-02-01T07:20:39.207250+00:00' + nullable: true + archived_by_user_id: + type: string + description: | + The unique id of an user who archived the card. + nullable: true total_transactions_count: type: integer nullable: false @@ -21769,6 +26436,8 @@ components: - virtual_card_id - virtual_card_state - nickname + - archived_at + - archived_by_user_id - total_transactions_count - unassigned_transactions_count corporate_card_in: @@ -21826,6 +26495,8 @@ components: - bank_name - card_number corporate_card_stats_in: + required: + - query_params properties: query_params: nullable: false @@ -21835,6 +26506,9 @@ components: example: user_id=eq.null corporate_card_stats_out: type: object + required: + - count + - transactions_count properties: count: type: integer @@ -21876,6 +26550,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - email + - full_name properties: id: allOf: @@ -22040,6 +26718,23 @@ components: description: | Unique nickname assigned to the card example: Business Card + is_archived: + type: boolean + description: | + Indicates whether the corporate card is archived. + nullable: false + archived_at: + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies when the card was archived + example: '2022-02-01T07:20:39.207250+00:00' + nullable: true + archived_by_user_id: + type: string + description: | + The unique id of an user who archived the card. + nullable: true total_transactions_count: type: integer nullable: false @@ -22079,6 +26774,8 @@ components: - virtual_card_id - virtual_card_state - nickname + - archived_at + - archived_by_user_id - total_transactions_count - unassigned_transactions_count corporate_card_reassign_in: @@ -22096,6 +26793,261 @@ components: required: - id - user_id + corporate_card_merge_in: + type: object + properties: + destination_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + description: | + The ID of the destination card into which the source card will be merged + example: bawownwrng + source_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + description: | + The ID of the source card that will be merged into the destination card + example: uswjwgnwwgo + required: + - destination_card_id + - source_card_id + corporate_card_archive_in: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + required: + - id + corporate_card_unarchive_in: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + required: + - id + duplicate_suggestion_corporate_card_out_embed: + type: object + additionalProperties: false + required: + - id + - bank_name + - card_number + - nickname + - total_transactions_count + - is_visa_enrolled + - is_mastercard_enrolled + - data_feed_source + - feed_display_name + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + bank_name: + type: string + description: | + Specifies the name of bank who issued the card. + example: Bank of America + card_number: + type: string + description: | + Specifies the masked number of the card. + example: xxxx-4543 + nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: Business Card + total_transactions_count: + type: integer + nullable: false + description: | + The total number of transactions for the card, in Sage Exp Mgmt + example: 100 + is_visa_enrolled: + type: boolean + description: | + If the card is enrolled with real time feed from visa + nullable: false + is_mastercard_enrolled: + type: boolean + description: | + If the card is enrolled with realtime feed from Mastercard + nullable: false + data_feed_source: + type: string + nullable: true + description: | + signifies the source of how card is added and how further card transactions could be synced + example: BANK FEED - CDF + feed_display_name: + type: string + nullable: true + description: | + A user-friendly name for the data feed source. + example: Bank Feed + corporate_card_duplicate_suggestion_out: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + org_id: + $ref: '#/components/schemas/org_id' + user_id: + type: string + maxLength: 255 + nullable: true + description: | + The unique id of an user to whom the card is assigned + example: uswjwgnwwgo + user: + $ref: '#/components/schemas/user_out_embed_nullable' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + destination_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + description: | + The ID of the destination card into which the source card will be merged + destination_card: + $ref: '#/components/schemas/duplicate_suggestion_corporate_card_out_embed' + source_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + example: baccownwrng + description: | + The ID of the source card that will be merged into the destination card + source_card: + $ref: '#/components/schemas/duplicate_suggestion_corporate_card_out_embed' + is_dismissed: + type: boolean + description: | + Indicates whether the duplicate suggestion has been dismissed by an admin + nullable: false + required: + - id + - org_id + - user_id + - user + - created_at + - updated_at + - destination_card_id + - destination_card + - source_card_id + - source_card + - is_dismissed + corporate_card_duplicate_suggestion_dismiss_in: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: ccdswownwrng + description: | + The ID of the duplicate suggestion to be dismissed + required: + - id + corporate_card_archive_suggestion_out: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + org_id: + $ref: '#/components/schemas/org_id' + user_id: + type: string + maxLength: 255 + nullable: true + description: | + The unique id of an user to whom the card is assigned + example: uswjwgnwwgo + user: + $ref: '#/components/schemas/user_out_embed_nullable' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + corporate_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + card_number: + type: string + description: | + Specifies the masked number of the card. + example: xxxx-4543 + bank_name: + type: string + description: | + Specifies the name of bank who issued the card. + example: Bank of America + nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: Business Card + data_feed_source: + type: string + nullable: true + description: | + signifies the source of how card is added and how further card transactions could be synced + example: BANK FEED - CDF + is_visa_enrolled: + type: boolean + description: | + If the card is enrolled with real time feed from visa + nullable: false + is_mastercard_enrolled: + type: boolean + description: | + If the card is enrolled with realtime feed from Mastercard + nullable: false + is_dismissed: + type: boolean + description: | + Indicates whether the archive suggestion has been dismissed by an admin + nullable: false + required: + - id + - org_id + - user_id + - user + - created_at + - updated_at + - corporate_card_id + - is_dismissed + - card_number + - bank_name + - nickname + - data_feed_source + - is_visa_enrolled + - is_mastercard_enrolled + corporate_card_archive_suggestion_dismiss_in: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: ccaswownwrng + description: | + The ID of the archive suggestion to be dismissed + required: + - id string_detail: type: string description: Additional string details of the card transaction. Can hold details upto 256 characters in length. @@ -22104,6 +27056,15 @@ components: corporate_card_out_embed: type: object additionalProperties: false + required: + - id + - bank_name + - card_number + - nickname + - cardholder_name + - masked_number + - user_full_name + - user_email properties: id: allOf: @@ -22153,6 +27114,11 @@ components: description: | String denoting the card holder's email example: john.doe@example.com + is_archived: + type: boolean + description: | + Indicates whether the corporate card is archived. + nullable: false matched_expense_out_embed: type: object nullable: true @@ -22566,6 +27532,10 @@ components: - last_user_matched_at - is_exported - metadata + - transaction_status + - mcc + - bank_transaction_number + - capitalone_virtual_card_last_four corporate_card_transaction_in: type: object properties: @@ -22853,7 +27823,11 @@ components: - last_user_matched_at - is_exported - metadata + - mcc corporate_card_transactions_stats_in: + type: object + required: + - query_params properties: query_params: nullable: false @@ -22863,6 +27837,10 @@ components: example: amount=gt.0&amount=lt.1000&created_at=gt.2021-01-01T00:00:00.000Z&created_at=lt.2021-12-31T23:59:59.999Z corporate_card_transactions_stats_out: type: object + required: + - count + - debit_amount + - credit_amount properties: count: type: integer @@ -22893,6 +27871,9 @@ components: - id corporate_card_transactions_delete_summary_out: type: object + required: + - delete_count + - delete_amount properties: delete_count: type: integer @@ -22918,6 +27899,15 @@ components: corporate_card_transaction_filters_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - name + - is_shared + - query_string properties: id: allOf: @@ -23185,6 +28175,7 @@ components: - matched_expenses - last_user_matched_at - metadata + - mcc corporate_card_transaction_reassign_in: type: object properties: @@ -23424,6 +28415,8 @@ components: - matched_expenses - last_user_matched_at - metadata + - mcc + - is_exported corporate_card_transaction_mark_personal_out: type: object properties: @@ -23631,6 +28624,8 @@ components: - matched_expenses - last_user_matched_at - metadata + - mcc + - is_exported corporate_card_transaction_unmark_personal_out: type: object properties: @@ -23839,6 +28834,8 @@ components: - matched_expenses - last_user_matched_at - metadata + - mcc + - is_exported corporate_card_transaction_ignore_out: type: object properties: @@ -24053,6 +29050,9 @@ components: - matched_expenses - last_user_matched_at - metadata + - capitalone_virtual_card_last_four + - mcc + - is_exported corporate_card_transaction_undo_ignore_out: type: object additionalProperties: false @@ -24282,6 +29282,10 @@ components: - matched_expenses - last_user_matched_at - metadata + - transaction_status + - capitalone_virtual_card_last_four + - mcc + - bank_transaction_number corporate_card_transaction_match_in: type: object properties: @@ -24513,6 +29517,9 @@ components: - matched_expenses - last_user_matched_at - metadata + - capitalone_virtual_card_last_four + - mcc + - is_exported corporate_card_transaction_unmatch_in: type: object properties: @@ -24756,8 +29763,16 @@ components: - matched_expenses - last_user_matched_at - metadata + - transaction_status + - capitalone_virtual_card_last_four + - mcc + - bank_transaction_number + - is_exported corporate_card_transactions_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -24783,6 +29798,11 @@ components: corporate_card_transactions_export_config: type: object additionalProperties: true + required: + - type + - is_header_visible + - columns + - separate_line_items_entry properties: type: type: string @@ -24799,6 +29819,8 @@ components: example: true separate_line_items_entry: type: object + required: + - enabled properties: enabled: type: boolean @@ -24827,6 +29849,9 @@ components: type: array items: type: object + required: + - name + - formula properties: name: type: string @@ -24889,6 +29914,20 @@ components: corporate_card_transactions_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - notify_emails + - config + - file_id + - state + - processed_at + - completed_at + - failed_at properties: created_at: $ref: '#/components/schemas/created_at' @@ -25112,6 +30151,14 @@ components: admin_subscriptions_out: type: object additionalProperties: false + required: + - id + - is_enabled + - webhook_url + - updated_at + - created_at + - org_id + - subscribed_resources properties: id: $ref: '#/components/schemas/id_string' @@ -25171,6 +30218,16 @@ components: - reimbursement_id - reimbursement - comments + - creator_type + - is_verified + - is_physical_bill_submitted + - physical_bill_submitted_at + - is_exported + - employee_id + - state_display_name + - accounting_export_summary + - applied_advance_wallets + - auto_approval_state properties: id: $ref: '#/components/schemas/id_string' @@ -25370,6 +30427,23 @@ components: nullable: true description: | List of applied advance wallets + creator_type: + type: string + enum: + - USER + - SYSTEM + description: | + Indicates whether the report was created by a user or the system. + example: USER + auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null report_out_subscriptions_admin: type: object additionalProperties: false @@ -25405,6 +30479,24 @@ components: reimbursement_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - creator_user_id + - user_id + - org_id + - reimbursement_number + - amount + - currency + - purpose + - mode + - is_paid + - paid_at + - is_exported + - code + - employee_id + - employee properties: id: type: string @@ -25466,6 +30558,8 @@ components: $ref: '#/components/schemas/employee_out_embed' reimbursement_in_minimal: type: object + required: + - id properties: id: type: string @@ -25496,6 +30590,24 @@ components: example: 100 employee_account_summary_out: type: object + required: + - id + - created_at + - updated_at + - org_id + - org_currency + - user_email + - user_full_name + - cash_account_id + - cash_account + - cash_account_balance + - ccc_account_id + - ccc_account + - ccc_account_balance + - advance_account_ids + - advance_accounts + - advance_accounts_balance + - is_settleable properties: id: $ref: '#/components/schemas/id_integer' @@ -25553,6 +30665,14 @@ components: schedule_out: type: object additionalProperties: false + required: + - id + - created_at + - updated_at + - config + - org_id + - user_id + - is_enabled properties: id: $ref: '#/components/schemas/id_string' @@ -25587,6 +30707,8 @@ components: example: TRANSACTION schedule_in: type: object + required: + - is_enabled properties: id: $ref: '#/components/schemas/id_string' @@ -25608,6 +30730,15 @@ components: scheduled_callback_out: type: object additionalProperties: false + required: + - id + - url + - payload + - schedule_config + - is_enabled + - created_at + - updated_at + - org_id properties: id: $ref: '#/components/schemas/id_string' @@ -25627,6 +30758,11 @@ components: $ref: '#/components/schemas/org_id' scheduled_callback_in: type: object + required: + - url + - payload + - schedule_config + - is_enabled properties: id: $ref: '#/components/schemas/id_string' @@ -25669,6 +30805,9 @@ components: spend_overview_summary_data_out: type: object nullable: false + required: + - amount + - time_interval_marker properties: amount: $ref: '#/components/schemas/amount' @@ -25687,6 +30826,11 @@ components: spend_overview_by_merchant_data_out: type: object nullable: false + required: + - merchant_name + - amount + - percentage + - change_percentage properties: merchant_name: $ref: '#/components/schemas/merchant' @@ -25705,6 +30849,12 @@ components: spend_overview_by_project_data_out: type: object nullable: false + required: + - project_id + - project_display_name + - amount + - percentage + - change_percentage properties: project_id: $ref: '#/components/schemas/id_integer' @@ -25725,6 +30875,12 @@ components: spend_overview_by_category_data_out: type: object nullable: false + required: + - category_id + - category_display_name + - amount + - percentage + - change_percentage properties: category_id: $ref: '#/components/schemas/id_integer' @@ -25745,6 +30901,12 @@ components: spend_overview_by_department_data_out: type: object nullable: false + required: + - department_id + - department_display_name + - amount + - percentage + - change_percentage properties: department_id: $ref: '#/components/schemas/id_string' @@ -25759,6 +30921,13 @@ components: spend_overview_by_user_data_out: type: object nullable: false + required: + - user_id + - user_full_name + - user_email + - amount + - percentage + - change_percentage properties: user_id: $ref: '#/components/schemas/id_string' @@ -25775,6 +30944,17 @@ components: spend_overview_by_corporate_card_data_out: type: object nullable: false + required: + - card_id + - card_number + - card_holder_name + - card_nickname + - user_id + - user_full_name + - user_email + - amount + - percentage + - change_percentage properties: card_id: $ref: '#/components/schemas/id_string' @@ -25801,6 +30981,18 @@ components: description: | This id provided by Sage Exp Mgmt to identify a user. This can be null if the corporate card is not assigned to any user. example: sdfd2391 + user_full_name: + type: string + nullable: true + description: | + Full name of the user assigned to the corporate card. Can be null if card is not assigned. + example: John Doe + user_email: + type: string + nullable: true + description: | + Email of the user assigned to the corporate card. Can be null if card is not assigned. + example: john.doe@example.com amount: $ref: '#/components/schemas/amount' percentage: @@ -25810,6 +31002,17 @@ components: account_out: type: object additionalProperties: false + required: + - id + - created_at + - updated_at + - user_id + - type + - currency + - current_balance_amount + - tentative_balance_amount + - org_id + - category_id properties: id: allOf: @@ -25854,6 +31057,10 @@ components: account_in: type: object additionalProperties: false + required: + - user_id + - type + - currency properties: user_id: type: string @@ -25877,6 +31084,16 @@ components: tax_group_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - code + - name + - percentage + - is_enabled + - is_default properties: id: allOf: @@ -25901,6 +31118,11 @@ components: description: percentage of tax levied. is_enabled: $ref: '#/components/schemas/is_enabled' + is_default: + type: boolean + nullable: true + description: Indicates whether this tax group is the default for its percentage bucket. + example: false code: $ref: '#/components/schemas/code' tax_group_in: @@ -25928,6 +31150,11 @@ components: description: percentage of tax levied. is_enabled: $ref: '#/components/schemas/is_enabled' + is_default: + type: boolean + nullable: true + description: Indicates whether this tax group should be set as default for its percentage bucket. + example: false code: $ref: '#/components/schemas/code' budget_type: @@ -25952,9 +31179,43 @@ components: description: | Visibility of the budget example: ONLY_ADMINS + budget_status: + type: string + enum: + - ON_TRACK + - NEAR_LIMIT + - EXCEEDED + - DISABLED + description: | + Status of budget usage + example: ON_TRACK budget_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - alert_threshold + - is_enabled + - type + - amount_limit + - observer_ids + - project_ids + - cost_center_ids + - category_ids + - department_ids + - budget_start_date + - budget_end_date + - amount_spent + - amount_remaining + - utilisation_percentage + - budget_creator + - visibility + - status + - user_ids properties: id: $ref: '#/components/schemas/id_string' @@ -26020,12 +31281,6 @@ components: $ref: '#/components/schemas/id_string' example: - usge49ielgel - fiscal_year_start_month: - type: number - example: 10 - description: Month number of start of fiscal year - minimum: 1 - maximum: 12 budget_start_date: type: string nullable: true @@ -26068,6 +31323,16 @@ components: description: Utilisation percentage of the budget interval visibility: $ref: '#/components/schemas/budget_visibility' + status: + $ref: '#/components/schemas/budget_status' + user_ids: + type: array + items: + $ref: '#/components/schemas/id_string' + example: + - usge49ielgel + description: | + List of user ids budget_user_ids: type: array nullable: true @@ -26091,7 +31356,6 @@ components: - type - observer_ids - amount_limit - - fiscal_year_start_month - department_ids - project_ids - cost_center_ids @@ -26158,19 +31422,105 @@ components: $ref: '#/components/schemas/id_string' example: - usge49ielgel - fiscal_year_start_month: - type: number - example: 10 - description: Month number of start of fisical year - minimum: 1 - maximum: 12 visibility: $ref: '#/components/schemas/budget_visibility' user_ids: $ref: '#/components/schemas/budget_user_ids' + budget_post_out: + type: object + additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - alert_threshold + - is_enabled + - type + - amount_limit + - observer_ids + - project_ids + - cost_center_ids + - category_ids + - department_ids + - visibility + properties: + id: + $ref: '#/components/schemas/id_string' + org_id: + $ref: '#/components/schemas/org_id' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + is_enabled: + $ref: '#/components/schemas/is_enabled' + name: + allOf: + - $ref: '#/components/schemas/name' + example: Sales + type: + $ref: '#/components/schemas/budget_type' + amount_limit: + $ref: '#/components/schemas/amount' + alert_threshold: + nullable: true + type: number + example: 5000 + department_ids: + type: array + items: + $ref: '#/components/schemas/id_string' + example: + - 2222 + - 1221 + description: | + List of department ids + project_ids: + type: array + items: + $ref: '#/components/schemas/id_integer' + example: + - 2222 + - 1221 + description: | + List of project ids + cost_center_ids: + type: array + items: + $ref: '#/components/schemas/id_integer' + example: + - 2222 + - 1221 + description: | + List of cost center ids + category_ids: + type: array + items: + $ref: '#/components/schemas/id_integer' + example: + - 2222 + - 1221 + description: | + List of category ids + observer_ids: + type: array + items: + $ref: '#/components/schemas/id_string' + example: + - usge49ielgel + visibility: + $ref: '#/components/schemas/budget_visibility' budget_out_embed: type: object additionalProperties: false + required: + - id + - name + - type + - amount_limit + - is_enabled properties: id: $ref: '#/components/schemas/id_string' @@ -26194,6 +31544,14 @@ components: - spent - amount_limit - budget + - created_at + - updated_at + - id + - org_id + - start_date + - end_date + - budget_department_ids + - budget_project_ids additionalProperties: false properties: id: @@ -26252,6 +31610,65 @@ components: List of project ids budget: $ref: '#/components/schemas/budget_out_embed' + budget_exports_in: + type: object + additionalProperties: false + required: + - query_params + properties: + query_params: + allOf: + - $ref: '#/components/schemas/query_params' + nullable: false + description: | + Query parameters to filter budgets for export. + example: status=eq.Exceeded + budget_exports_out: + type: object + additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - file_id + - state + properties: + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: budexpXXXXXXXX + org_id: + $ref: '#/components/schemas/org_id' + user_id: + $ref: '#/components/schemas/user_id' + query_params: + allOf: + - $ref: '#/components/schemas/query_params' + nullable: false + file_id: + anyOf: + - $ref: '#/components/schemas/null_field' + - $ref: '#/components/schemas/id_string' + nullable: true + example: filumWHrlPf7K + state: + type: string + nullable: false + enum: + - PENDING + - PROCESSING + - SUCCESS + - ERROR + description: | + Status of the export. + example: PENDING org_out: type: object additionalProperties: false @@ -26262,6 +31679,8 @@ components: - currency - created_at - updated_at + - is_current + - is_primary properties: id: $ref: '#/components/schemas/org_id' @@ -26322,6 +31741,35 @@ components: nullable: false description: | Determines whether this organization has been verified. + org_weekly_invitation_usage_out: + type: object + additionalProperties: false + required: + - id + - invitation_sent + - is_limit_reached + - weekly_limit + properties: + id: + $ref: '#/components/schemas/org_id' + weekly_limit: + type: integer + nullable: true + description: | + The maximum number of employee invitations allowed per week. + This is `null` when the organisation is within its onboarding period and no limit applies. + example: 50 + invitation_sent: + type: integer + description: | + The number of successful employee invitations sent during the current calendar week. + example: 12 + is_limit_reached: + type: boolean + description: | + Indicates whether the weekly invitation limit has been reached. + Always `false` when `weekly_limit` is `null`. + example: false expense_policy_limit_type: nullable: true type: string @@ -26358,6 +31806,16 @@ components: - COMPANY_ACCOUNT - null example: PERSONAL_CASH_ACCOUNT + contains_from_list_operator: + nullable: true + type: string + enum: + - CONTAINS_ANY_FROM_LIST + - CONTAINS_NONE_FROM_LIST + - null + description: | + Value signifying the operator for matching values from a list field. + example: CONTAINS_ANY_FROM_LIST vehicle_type: type: string enum: @@ -26373,6 +31831,77 @@ components: expense_policy_out: type: object additionalProperties: true + required: + - created_at + - updated_at + - id + - org_id + - is_enabled + - is_retired + - description + - source + - creator_user_id + - creator_user + - approver_order + - is_approver_policy + - employee_department_ids + - employee_department_ids_op + - employee_level_ids + - employee_level_ids_op + - employee_titles + - employee_titles_op + - employee_user_ids + - employee_user_ids_op + - employee_custom_fields + - employee_custom_fields_op + - employee_locations + - employee_locations_op + - expense_category_ids + - expense_category_ids_op + - expense_limit_type + - expense_amount_max + - expense_amount_min + - expense_creation_delay_days_max + - expense_currency + - expense_without_receipt_allowed + - expense_allowed_distance_difference_percentage + - expense_flight_travel_class + - expense_project_ids + - expense_project_ids_op + - expense_train_travel_class + - expense_spent_at_max + - expense_spent_at_min + - expense_locations + - expense_locations_op + - expense_allowed_exchange_rate_difference_percentage + - expense_include_foreign_currency + - expense_annual_distance_max + - expense_vehicle_type + - expense_cost_center_ids + - expense_cost_center_ids_op + - expense_distance_max + - expense_distance_min + - expense_custom_fields + - expense_custom_fields_op + - expense_without_ccc_match_allowed + - expense_fiscal_start_month + - expense_payment_modes + - expense_payment_modes_op + - action_flag + - action_show_warning + - action_cap_amount + - action_make_unreportable + - action_remove_employee_approver1 + - action_add_employee_approver2 + - action_add_employee_approver3 + - action_add_project_approver1 + - action_add_project_approver2 + - action_add_department_head_approver + - action_add_approver_user_ids + - action_override_distance_slab_rate + - expense_merchants + - expense_merchants_op + - policy_violation_reason_required properties: id: allOf: @@ -26600,6 +32129,22 @@ components: nullable: true allOf: - $ref: '#/components/schemas/contains_operator' + expense_merchants: + nullable: true + type: array + items: + type: string + description: | + List of merchant names considered by this policy rule. + example: + - Uber + - Amazon + expense_merchants_op: + nullable: true + allOf: + - $ref: '#/components/schemas/contains_from_list_operator' + description: | + Operator to apply on `expense_merchants`. expense_without_ccc_match_allowed: type: boolean description: | @@ -26738,6 +32283,12 @@ components: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: false example: true + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule. + default: false + example: false action_make_unreportable: type: boolean description: | @@ -26844,6 +32395,8 @@ components: - expense_amount_max - expense_payment_modes - expense_payment_modes_op + - expense_merchants + - expense_merchants_op - expense_without_ccc_match_allowed - employee_department_ids - employee_department_ids_op @@ -26854,6 +32407,7 @@ components: - employee_titles_op - action_flag - action_show_warning + - policy_violation_reason_required - action_make_unreportable - description default: true @@ -27046,6 +32600,23 @@ components: - $ref: '#/components/schemas/contains_operator' description: | _Note: This field is mandatory if the field `expense_payment_modes` is present in the request body._ + expense_merchants: + type: array + items: + type: string + description: | + List of merchant names to be checked against expense merchant for applying this policy rule.
+ _Note: You need to use field `expense_merchants_op` along with this field._
+ _Note: This field is allowed only when `expense_without_receipt_allowed` is false._ + example: + - Uber + - Amazon + expense_merchants_op: + allOf: + - $ref: '#/components/schemas/contains_from_list_operator' + description: | + _Note: This field is mandatory if the field `expense_merchants` is present in the request body._
+ _Note: This field is allowed only when `expense_without_receipt_allowed` is false._ expense_without_ccc_match_allowed: type: boolean description: | @@ -27197,6 +32768,13 @@ components: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: false example: true + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule.
+ _Note: This can be true only when `action_show_warning` is true._ + default: false + example: false action_make_unreportable: type: boolean description: | @@ -27292,6 +32870,11 @@ components: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: true + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false @@ -27333,6 +32916,11 @@ components: example: eq.ouNSnadfaLA expense_policy_expenses_query_object: type: object + required: + - limit_start_date + - limit_end_date + - params + nullable: true description: | An expense may be violating an expense policy rule due to a group of other expenses. These query params can be used to fetch those expenses because of which this expense is causing a violation.
@@ -27343,6 +32931,7 @@ components: description: | Spend start date query param to find the list of violating expenses. example: '2021-12-01' + nullable: true limit_end_date: type: string description: | @@ -27352,6 +32941,17 @@ components: $ref: '#/components/schemas/expense_policy_expenses_query_object_params' expense_policy_individual_desired_states: type: object + required: + - add_approver_user_ids + - approver_policy_order + - approver_source + - expense_id + - expense_policy_rule_id + - expense_policy_rule + - run_status + - run_result + - amount + - expenses_query_object properties: add_approver_user_ids: nullable: true @@ -27422,7 +33022,7 @@ components: description: | This represents the id of the expense policy rule. example: tprabsdfSYqd - rule: + expense_policy_rule: $ref: '#/components/schemas/expense_policy_rule_embed' amount: nullable: true @@ -27432,11 +33032,21 @@ components: description: | Amount that the policy calculation suggests for this expense. example: 500 - expenses_query_object_params: + expenses_query_object: nullable: true $ref: '#/components/schemas/expense_policy_expenses_query_object' expense_policy_final_desired_state: type: object + required: + - expense_id + - flag + - amount + - unreportable + - is_receipt_mandatory + - add_approver_user_ids + - remove_employee_approver1 + - run_status + - run_summary properties: expense_id: type: string @@ -27503,6 +33113,10 @@ components: expense_policy_states_out: type: object additionalProperties: false + required: + - expense_id + - individual_desired_states + - final_desired_state properties: expense_id: type: string @@ -27600,6 +33214,9 @@ components: type: array items: type: object + required: + - ids + - duplicate_line_item_statement_id properties: ids: type: array @@ -27658,6 +33275,7 @@ components: - file_id - is_processed - statement_mappings_id + - creator_user statements_in: type: object properties: @@ -27782,30 +33400,34 @@ components: additionalProperties: false properties: id: - allOf: - - $ref: '#/components/schemas/id_string' + type: string + nullable: true example: stmpwownwrng bank_name: type: string description: | Specifies the bank name of the statement. example: American Express + nullable: true is_debit_positive: type: boolean description: | Specifies the representation of the the amount in the statement, if true then the amount represented by positive sign are debits, and if false then the amount represented by negative sign are debits. example: true + nullable: true transaction_date_column: type: string description: | Specifies the header name of the transaction date column in the statement. example: spent date + nullable: true merchant_column: type: string description: | Specifies the header name of the merchant column in the statement. example: merchant + nullable: true transaction_id_column: type: string description: | @@ -27817,11 +33439,13 @@ components: description: | Specifies the header name of the amount column in the statement. example: amount + nullable: true name: type: string description: | Specifies the mapping name. example: amex_mapping + nullable: true card_number_column: type: string description: | @@ -27862,6 +33486,17 @@ components: Specifies the credit card network used by the card example: VISA nullable: true + org_id: + type: string + nullable: true + created_at: + type: string + format: date-time + nullable: true + updated_at: + type: string + format: date-time + nullable: true required: - id - bank_name @@ -27878,6 +33513,9 @@ components: - post_date_column - is_auto_created - card_network + - org_id + - created_at + - updated_at preview_from_statement_in: type: object properties: @@ -27888,6 +33526,12 @@ components: statement_mapping: type: object properties: + id: + type: string + nullable: true + description: | + Specifies the id of the statement mapping. + example: stmpabcd1234 description_column: type: string description: | @@ -27962,19 +33606,12 @@ components: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -27988,10 +33625,17 @@ components: description: | Card number from statement can be passed to get transactions only from specific card example: xxx5-4543 + start_date: + $ref: '#/components/schemas/timestamptz_utc' + description: | + Start date of the statement period + end_date: + $ref: '#/components/schemas/timestamptz_utc' + description: | + End date of the statement period required: - id - statement_mapping - - ignored_line_item_ids preview_out: properties: no_of_debit: @@ -28096,6 +33740,20 @@ components: - no_of_debit - no_of_credit - no_of_transactions + card_mapping_in: + type: array + items: + type: object + properties: + statement_card_number: + type: string + description: | + Card number from statement + example: xxx5-4543 + corporate_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng summary_from_statement_in: type: object properties: @@ -28180,19 +33838,12 @@ components: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -28201,11 +33852,29 @@ components: This specifies list of statement line items to be ignored in the statement. example: - stlisfdfadssd + card_mapping: + $ref: '#/components/schemas/card_mapping_in' + ignore_archived_cards: + type: boolean + nullable: true + description: | + Controls how transactions associated with archived cards are handled during statement processing: + If true, transactions associated with archived cards are ignored. + If false, the archived cards are unarchived, and their associated transactions are processed. required: - id - statement_mapping - - ignored_line_item_ids summary_out: + type: object + required: + - id + - status + - period_start + - period_end + - statement_transaction_count + - statement_total + - total_cards + - bridging_entry_change_type properties: id: allOf: @@ -28249,20 +33918,6 @@ components: If this period is created as bridging entry because of change in reconciliation type, then this field will indicate such change. example: STATEMENT_CYCLE_TO_CALENDAR_MONTH - card_mapping_in: - type: array - items: - type: object - properties: - statement_card_number: - type: string - description: | - Card number from statement - example: xxx5-4543 - corporate_card_id: - allOf: - - $ref: '#/components/schemas/id_string' - example: bawownwrng reconciliation_summary_from_statement_in: type: object properties: @@ -28347,19 +34002,12 @@ components: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -28387,12 +34035,24 @@ components: type: string example: - recexxxxxx + ignore_archived_cards: + type: boolean + nullable: true + description: | + Controls how transactions associated with archived cards are handled during statement processing: + If true, transactions associated with archived cards are ignored. + If false, the archived cards are unarchived, and their associated transactions are processed. required: - id - statement_mapping - - ignored_line_item_ids - reconciliation_entry_ids _reconciliation_summary_object: + type: object + required: + - expense_count + - is_recommended + - reconciliation_method + - statement_transaction_count properties: expense_count: description: Number of expense matches found @@ -28410,6 +34070,9 @@ components: type: number example: 12 reconciliation_summary_out: + type: object + required: + - reconciliation_summary properties: reconciliation_summary: type: array @@ -28425,6 +34088,12 @@ components: statement_mapping: type: object properties: + id: + type: string + nullable: true + description: | + Specifies the id of the statement mapping. + example: stmpabcd1234 description_column: type: string description: | @@ -28499,19 +34168,12 @@ components: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -28524,12 +34186,10 @@ components: $ref: '#/components/schemas/timestamptz_utc' description: | Start date of the statement period - nullable: true end_date: $ref: '#/components/schemas/timestamptz_utc' description: | End date of the statement period - nullable: true card_mapping: $ref: '#/components/schemas/card_mapping_in' reconciliation_method: @@ -28547,10 +34207,16 @@ components: type: string example: - recexxxxxx + ignore_archived_cards: + type: boolean + nullable: true + description: | + Controls how transactions associated with archived cards are handled during statement processing: + If true, transactions associated with archived cards are ignored. + If false, the archived cards are unarchived, and their associated transactions are processed. required: - id - statement_mapping - - ignored_line_item_ids - reconciliation_method - reconciliation_entry_ids unassigned_cards_from_statement_in: @@ -28648,19 +34314,12 @@ components: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -28679,10 +34338,17 @@ components: - stlisfdfadssd card_mapping: $ref: '#/components/schemas/card_mapping_in' + ignore_archived_cards: + type: boolean + nullable: true + description: | + Controls how transactions associated with archived cards are handled during statement processing: + If true, transactions associated with archived cards are ignored. + If false, the archived cards are unarchived, and their associated transactions are processed. + example: false required: - id - statement_mapping - - ignored_line_item_ids card_stats_out: properties: missing_transactions_count: @@ -28701,7 +34367,7 @@ components: Card network of the statement if the statement has atleast one card enrolled in RTF. example: VISA nullable: true - missing_corporate_card_details: + corporate_card_details: type: array items: type: object @@ -28734,7 +34400,13 @@ components: required: - missing_transactions_count - is_rtf_statement + - rtf_card_network + - corporate_card_details matching_cards_out: + type: object + required: + - statement_card_number + - matching_cards properties: statement_card_number: type: string @@ -28745,6 +34417,14 @@ components: type: array items: type: object + required: + - id + - card_number + - is_visa_enrolled + - is_mastercard_enrolled + - nickname + - user + - is_archived properties: id: allOf: @@ -28771,8 +34451,20 @@ components: example: Business Card user: $ref: '#/components/schemas/user_out_embed_nullable' + is_archived: + type: boolean + description: | + If the card is archived in Sage Exp Mgmt + nullable: false rtf_missing_transaction_from_statement_out: type: object + required: + - error + - missing_rtf_transactions + - rtf_confidence + - rtf_count + - total_count + - status properties: error: type: string @@ -28784,9 +34476,24 @@ components: type: array items: type: object + required: + - amount + - bank_name + - card_number + - currency + - description + - foreign_amount + - foreign_currency + - merchant + - post_date + - statement_line_item_id + - transaction_date + - transaction_id + - transaction_type + - unique_id properties: amount: - type: number + type: string description: | Specifies the amount on the statement. example: 30 @@ -29015,21 +34722,211 @@ components: - reconciliation_method rtf_stats_out: type: object + required: + - last_uploaded_at + - rtf_confidence properties: last_uploaded_at: - $ref: '#/components/schemas/timestamptz_utc' + oneOf: + - $ref: '#/components/schemas/timestamptz_utc' + - type: string + maxLength: 0 description: | Timestamp of the last uploaded statement. + Either a date-time string or an empty string. rtf_confidence: type: string description: | RTF Confidence percentage indicates what % of the transactions in last uploaded statement are already existing in Sage Exp Mgmt via RTF. example: 99.22 + statement_archived_cards_in: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: stmtadfdsdf + statement_mapping: + type: object + properties: + description_column: + type: string + description: | + Specifies the mapping of description column on the statement + nullable: true + example: description + transaction_date_column: + type: string + description: | + Specifies the mapping of transaction date on the statement. + example: txn date + transaction_id_column: + type: string + description: | + Specifies the mapping of transaction id / unique id on the statement. + example: reference number + nullable: true + amount_column: + type: string + description: | + Specifies the mapping of amount on the statement. + example: amount + card_number_column: + type: string + description: | + Specifies the mapping of card number on the statement. + example: account number + merchant_column: + type: string + description: | + Specifies the mapping of merchant on the statement. + example: Amazon + foreign_amount_column: + type: string + description: | + Specifies the mapping of foreign amount on the statement. + example: foreign amount + nullable: true + foreign_currency_column: + type: string + description: | + Specifies the mapping of foreign currency on the statement. + example: foreign currency + nullable: true + post_date_column: + type: string + description: | + Specifies the header name of the post date column in the statement. + example: post date + nullable: true + bank_name: + type: string + description: | + Specifies the bank name of the statement + example: American Express + is_debit_positive: + type: boolean + description: | + Specifies the representation of the the amount in the statement, if true then the amount represented by | + positive sign are debits, and if false then the amount represented by negative sign are debits. + example: true + name: + type: string + description: | + Specifies the mapping name. + example: USD + nullable: true + card_network: + type: string + description: | + Specifies the credit card network used by the card + example: VISA + nullable: true + required: + - transaction_date_column + - amount_column + - card_number_column + - merchant_column + - bank_name + - is_debit_positive + ignored_line_item_ids: + type: array + items: + type: string + description: | + This specifies list of statement line items to be ignored in the statement. + example: + - stlisfdfadssd + start_date: + $ref: '#/components/schemas/timestamptz_utc' + description: | + Start date of the statement period + nullable: true + end_date: + $ref: '#/components/schemas/timestamptz_utc' + description: | + End date of the statement period + nullable: true + card_mapping: + $ref: '#/components/schemas/card_mapping_in' + required: + - id + - statement_mapping + statement_archived_cards_out: + required: + - number_of_cards + - number_of_archived_cards + - archived_cards + properties: + number_of_cards: + type: integer + description: | + Number of cards in the statement + example: 3 + number_of_archived_cards: + type: integer + description: | + Number of cards in the statement that are archived in Sage Exp Mgmt + example: 1 + archived_cards: + type: array + items: + type: object + required: + - id + - card_number + - nickname + - user + - is_archived + - archived_at + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + card_number: + $ref: '#/components/schemas/card_number' + nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: Business Card + user: + $ref: '#/components/schemas/user_out_embed_nullable' + is_archived: + type: boolean + description: | + If the card is archived in Sage Exp Mgmt + nullable: false + archived_at: + $ref: '#/components/schemas/timestamptz_utc' + description: | + Timestamp when the card was archived in Sage Exp Mgmt + nullable: true + statement_archived_cards_ignore_in: + allOf: + - $ref: '#/components/schemas/statement_archived_cards_in' + - type: object + properties: + archived_card_ids: + type: array + items: + type: string + description: | + List of archived card ids to be ignored in the statement. + example: + - bawownwrng + required: + - archived_card_ids expense_rule_if_out: type: object additionalProperties: false required: - merchant_contains + - department_ids + - departments properties: merchant_contains: type: string @@ -29058,6 +34955,18 @@ components: nullable: false additionalProperties: false minProperties: 1 + required: + - merchant + - is_billable + - purpose + - category_id + - category + - project_id + - project + - cost_center_id + - cost_center + - custom_fields + - dependent_fields properties: merchant: type: string @@ -29128,6 +35037,8 @@ components: - creator_user - if - set + - is_suggested + - is_suggestion_dismissed properties: id: allOf: @@ -29290,6 +35201,16 @@ components: $ref: '#/components/schemas/distance' distance_unit: $ref: '#/components/schemas/distance_unit' + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. started_at: $ref: '#/components/schemas/timestamptz_pst' ended_at: @@ -29362,6 +35283,242 @@ components: - 12423 description: | List of IDs of expense fields which are mandatory but are missing. + admin_expense_check_mandatory_fields_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be checked for missing mandatory fields by admin. + items: + $ref: '#/components/schemas/items' + expense_check_mandatory_fields_bulk_out: + type: array + additionalProperties: false + items: + type: object + required: + - id + - missing_amount + - missing_currency + - missing_receipt + - missing_expense_field_ids + properties: + id: + $ref: '#/components/schemas/id_string' + example: tx0agOdICdbV + missing_amount: + type: boolean + description: | + If this is set to true, then you need to send amount field with expense object. + example: false + missing_currency: + type: boolean + description: | + If this is set to true, then you need to send currency field with expense object. + example: false + missing_receipt: + type: boolean + description: | + If this is set to true, then you need to attach receipt to the expense. + example: false + missing_expense_field_ids: + type: array + nullable: false + items: + type: integer + nullable: true + description: | + This id provided by Sage Exp Mgmt to identify an expense field. + example: 123 + example: + - 123 + - 12423 + description: | + List of IDs of expense fields which are mandatory but are missing. + admin_check_policies_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be validated against expense policy rules by admin. + items: + $ref: '#/components/schemas/items' + expense_check_policies_individual_desired_states: + type: object + required: + - add_approver_user_ids + - approver_policy_order + - approver_source + - expense_policy_rule_id + - expense_policy_rule + - run_status + - run_result + - amount + - expenses_query_object + properties: + add_approver_user_ids: + nullable: true + type: array + items: + type: string + description: | + List of approver ids that the policy calculation suggests adding to report that contains this expense. + example: + - usBdsdfscl + - usLSsdfwqt + approver_policy_order: + type: integer + nullable: true + description: | + This represents the order of the approver policy related to this individual desired state record. + If the policy does not add any approver, this field will be null. + example: 1 + approver_source: + type: string + enum: + - PRIMARY_APPROVER + - SECONDARY_APPROVER_1 + - SECONDARY_APPROVER_2 + - PROJECT_APPROVER_1 + - PROJECT_APPROVER_2 + - DEPARTMENT_HEAD_APPROVER + - EMAIL_APPROVER + - null + nullable: true + description: | + This represents the type of approver(source) that was added by the approver policy related to this individual + desired state record. If the policy does not add any approver, this field will be null. + example: PROJECT_APPROVER_1 + expense_policy_rule_id: + type: string + description: | + This represents the id of the expense policy rule. + example: tprabsdfSYqd + expense_policy_rule: + $ref: '#/components/schemas/expense_policy_rule_embed' + run_status: + nullable: false + type: string + enum: + - VIOLATED_ACTION_SUCCESS + - VIOLATED_ACTION_FAILURE + - UNVIOLATED + description: | + This represents the status of policy computation for the input expense object against the policy represented by `expense_policy_rule_id`. + If the state is `UNVIOLATED`, it means that the expense is not violating this policy. If the state is `VIOLATION_ACTION_SUCCESS`, + it means that the expense is violating this policy and action stated in the object will be applied to the expense when it is saved. + However, if the state is `VIOLATION_ACTION_FAILURE`, it means that this policy is violated for the expense but since some approver was + missing or not set up properly, it will fail to take action on the expense when it is saved. + example: SUCCESS + run_result: + type: array + items: + type: string + description: | + List of human-readable action summaries that the policy calculation suggests for this expense. Note that, in + case some approver was not setup properly for the given violation, this array will contain description of + missing approvers. For example, Department approver, Project head, etc. + example: + - flag the expense + - cap the amount + amount: + nullable: true + anyOf: + - $ref: '#/components/schemas/amount' + - $ref: '#/components/schemas/null_field' + description: | + Amount that the policy calculation suggests for this expense. + example: 500 + expenses_query_object: + nullable: true + $ref: '#/components/schemas/expense_policy_expenses_query_object' + expense_check_policies_final_desired_state: + type: object + required: + - flag + - amount + - unreportable + - is_receipt_mandatory + - add_approver_user_ids + - remove_employee_approver1 + - run_status + - run_summary + properties: + flag: + type: boolean + description: | + A true value here means, that as per policy calculation this expense should be flagged. + example: true + amount: + nullable: true + anyOf: + - $ref: '#/components/schemas/amount' + - $ref: '#/components/schemas/null_field' + description: | + Amount that the policy calculation suggests for this expense. + example: 500 + unreportable: + type: boolean + nullable: false + description: | + A true value here means, that as per policy calculation this expense should be made unreportable. + example: true + is_receipt_mandatory: + type: boolean + description: | + A true value here means, that as per policy calculation this expense requires receipt. + example: true + add_approver_user_ids: + nullable: true + type: array + items: + type: string + description: | + List of approver ids that the policy calculation suggests adding to report that contains this expense. + example: + - usBdsdfscl + - usLSsdfwqt + remove_employee_approver1: + type: boolean + description: | + A true value here means, that as per policy calculation, the employee's first approver should be removed from the report that contains this expense. + example: true + run_status: + nullable: false + type: string + enum: + - SUCCESS + - FAILURE + description: | + This represent the run status of the policy. + example: SUCCESS + run_summary: + type: array + items: + type: string + description: | + List of human-readable action summaries that the policy calculation suggests for this expense. + example: + - flag the expense + - cap the amount + expense_check_policies_bulk_out: + type: array + additionalProperties: false + items: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: tx0agOdICdbV + individual_desired_states: + type: array + items: + $ref: '#/components/schemas/expense_check_policies_individual_desired_states' + final_desired_state: + $ref: '#/components/schemas/expense_check_policies_final_desired_state' + expense_action_data_embed: + type: object + description: Data related to expense action. + nullable: true expense_comments_out: type: object additionalProperties: false @@ -29375,6 +35532,8 @@ components: - org_id - updated_at - created_at + - creator_user_id + - creator_user properties: id: $ref: '#/components/schemas/id_string' @@ -29407,9 +35566,7 @@ components: - UNMATCHED example: COMMENTED_WITH_NOTIFICATION action_data: - type: object - description: Data related to expense action. - nullable: true + $ref: '#/components/schemas/expense_action_data_embed' expense_id: $ref: '#/components/schemas/id_string' creator_type: @@ -29440,7 +35597,6 @@ components: required: - expense_id - comment - - notify properties: expense_id: $ref: '#/components/schemas/id_string' @@ -29472,6 +35628,9 @@ components: description: | List of expense IDs that needs to be dismissed as a duplicate from the target expense expenses_duplicate_sets_stats_in: + type: object + required: + - query_params properties: query_params: nullable: false @@ -29482,6 +35641,8 @@ components: example: '' expenses_duplicate_sets_stats_out: type: object + required: + - count properties: count: type: integer @@ -29499,9 +35660,23 @@ components: items: $ref: '#/components/schemas/any_type' - type: object + additionalProperties: + $ref: '#/components/schemas/any_type' + - {} feature_config_out: type: object additionalProperties: false + required: + - org_id + - user_id + - created_at + - updated_at + - target_client + - feature + - sub_feature + - key + - value + - is_shared properties: org_id: $ref: '#/components/schemas/org_id' @@ -29624,7 +35799,7 @@ components: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' is_reimbursable: $ref: '#/components/schemas/is_reimbursable' @@ -29701,7 +35876,7 @@ components: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' category_id: allOf: @@ -29768,148 +35943,12 @@ components: null or default value will be taken for that attribute in the resultant split. allOf: - $ref: '#/components/schemas/admin_expense_split_object' - expense_check_policies_individual_desired_states: - type: object - properties: - add_approver_user_ids: - nullable: true - type: array - items: - type: string - description: | - List of approver ids that the policy calculation suggests adding to report that contains this expense. - example: - - usBdsdfscl - - usLSsdfwqt - approver_policy_order: - type: integer - nullable: true - description: | - This represents the order of the approver policy related to this individual desired state record. - If the policy does not add any approver, this field will be null. - example: 1 - approver_source: - type: string - enum: - - PRIMARY_APPROVER - - SECONDARY_APPROVER_1 - - SECONDARY_APPROVER_2 - - PROJECT_APPROVER_1 - - PROJECT_APPROVER_2 - - DEPARTMENT_HEAD_APPROVER - - EMAIL_APPROVER - - null - nullable: true - description: | - This represents the type of approver(source) that was added by the approver policy related to this individual - desired state record. If the policy does not add any approver, this field will be null. - example: PROJECT_APPROVER_1 - expense_policy_rule_id: - type: string - description: | - This represents the id of the expense policy rule. - example: tprabsdfSYqd - expense_policy_rule: - $ref: '#/components/schemas/expense_policy_rule_embed' - run_status: - nullable: false - type: string - enum: - - VIOLATED_ACTION_SUCCESS - - VIOLATED_ACTION_FAILURE - - UNVIOLATED - description: | - This represents the status of policy computation for the input expense object against the policy represented by `expense_policy_rule_id`. - If the state is `UNVIOLATED`, it means that the expense is not violating this policy. If the state is `VIOLATION_ACTION_SUCCESS`, - it means that the expense is violating this policy and action stated in the object will be applied to the expense when it is saved. - However, if the state is `VIOLATION_ACTION_FAILURE`, it means that this policy is violated for the expense but since some approver was - missing or not set up properly, it will fail to take action on the expense when it is saved. - example: SUCCESS - run_result: - type: array - items: - type: string - description: | - List of human-readable action summaries that the policy calculation suggests for this expense. Note that, in - case some approver was not setup properly for the given violation, this array will contain description of - missing approvers. For example, Department approver, Project head, etc. - example: - - flag the expense - - cap the amount - amount: - nullable: true - anyOf: - - $ref: '#/components/schemas/amount' - - $ref: '#/components/schemas/null_field' - description: | - Amount that the policy calculation suggests for this expense. - example: 500 - expenses_query_object_params: - nullable: true - $ref: '#/components/schemas/expense_policy_expenses_query_object' - expense_check_policies_final_desired_state: - type: object - properties: - flag: - type: boolean - description: | - A true value here means, that as per policy calculation this expense should be flagged. - example: true - amount: - nullable: true - anyOf: - - $ref: '#/components/schemas/amount' - - $ref: '#/components/schemas/null_field' - description: | - Amount that the policy calculation suggests for this expense. - example: 500 - unreportable: - type: boolean - nullable: false - description: | - A true value here means, that as per policy calculation this expense should be made unreportable. - example: true - is_receipt_mandatory: - type: boolean - description: | - A true value here means, that as per policy calculation this expense requires receipt. - example: true - add_approver_user_ids: - nullable: true - type: array - items: - type: string - description: | - List of approver ids that the policy calculation suggests adding to report that contains this expense. - example: - - usBdsdfscl - - usLSsdfwqt - remove_employee_approver1: - type: boolean - description: | - A true value here means, that as per policy calculation, the employee's first approver should be removed from the report that contains this expense. - example: true - run_status: - nullable: false - type: string - enum: - - SUCCESS - - FAILURE - description: | - This represent the run status of the policy. - example: SUCCESS - run_summary: - type: array - items: - type: string - description: | - List of human-readable action summaries that the policy calculation suggests for this expense. - example: - - flag the expense - - cap the amount expense_check_policies_out: type: object additionalProperties: false + required: + - individual_desired_states + - final_desired_state properties: individual_desired_states: type: array @@ -29920,6 +35959,12 @@ components: org_bank_details_out: type: object additionalProperties: false + required: + - org_id + - bank_account_number + - bank_branch_ifsc + - dwolla_customers_metadata_id + - is_bank_account_added properties: org_id: $ref: '#/components/schemas/org_id' @@ -29948,6 +35993,11 @@ components: merchant_out: type: object additionalProperties: false + required: + - id + - created_at + - updated_at + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -29963,6 +36013,21 @@ components: reconciliation_entry_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - period_start + - period_end + - status + - reconciled_on + - reconciled_by + - bridging_entry_change_type + - statement_transaction_count + - expense_count + - statement_total + - expense_total properties: id: type: string @@ -30074,6 +36139,12 @@ components: - amount - state - purpose + - currency + - merchant + - spent_at + - file_ids + - category + - project properties: id: allOf: @@ -30139,6 +36210,29 @@ components: nullable: true example: Team lunch description: Purpose or description of this split line. + matched_corporate_card_transaction: + type: object + nullable: true + description: Matched corporate card transaction details for this expense, if any. + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: btxnwownwrng + description: Id of the matched corporate card transaction. + status: + type: string + enum: + - PENDING + - POSTED + description: Status of the matched corporate card transaction. + example: POSTED + files: + type: array + nullable: true + description: List of files attached to this expense split. + items: + $ref: '#/components/schemas/file_out_embed' reconciliation_matched_expense_out_embed: type: object additionalProperties: false @@ -30153,6 +36247,7 @@ components: - project - purpose - splits + - currency properties: id: allOf: @@ -30220,6 +36315,29 @@ components: nullable: true example: Team lunch description: Purpose or description of the expense. + matched_corporate_card_transaction: + type: object + nullable: true + description: Matched corporate card transaction details for this expense, if any. + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: btxnwownwrng + description: Id of the matched corporate card transaction. + status: + type: string + enum: + - PENDING + - POSTED + description: Status of the matched corporate card transaction. + example: POSTED + files: + type: array + nullable: true + description: List of files attached to this expense. + items: + $ref: '#/components/schemas/file_out_embed' splits: type: array nullable: true @@ -30239,6 +36357,12 @@ components: - matched_expenses_count - is_reconciled - expenses + - statement_line_item_id + - expense_ids + - statement_transaction_date + - statement_post_date + - created_at + - updated_at properties: id: $ref: '#/components/schemas/id_string' @@ -30307,6 +36431,74 @@ components: updated_at: $ref: '#/components/schemas/updated_at' description: Timestamp when this reconciliation transaction record was last updated. + reconciliation_transactions_stats_in: + type: object + additionalProperties: false + description: | + Input to fetch reconciliation transactions stats for a specific card or filter. + Pass filters using the `query_params` string similar to the GET list API. + For example, filter by a single card using `corporate_card_id=eq.`. + required: + - query_params + properties: + query_params: + type: string + description: | + Query param string similar to reconciliation transactions GET call. Use this to filter the population + before computing stats. For individual card stats, pass `corporate_card_id=eq.`. + example: corporate_card_id=eq.bawownwrng + reconciliation_transactions_stats_out: + type: object + required: + - period_start + - period_end + - statement_transaction_count + - expense_count + - statement_total + - expense_total + - difference + - matching_issue_count + additionalProperties: false + description: | + Reconciliation transactions statistics for the selected filter period. + properties: + period_start: + type: string + format: date-time + description: Start of the reconciliation period in UTC. + example: '2025-10-01T00:00:00.000+00:00' + period_end: + type: string + format: date-time + description: End of the reconciliation period in UTC. + example: '2025-10-31T23:59:59.999+00:00' + statement_transaction_count: + type: integer + description: Number of statement transactions considered in the period. + example: 3 + expense_count: + type: integer + description: Number of expenses considered in the period. + example: 2 + statement_total: + type: number + format: double + description: Sum of statement transaction amounts considered in the period. + example: 45 + expense_total: + type: number + format: double + description: Sum of expense amounts considered in the period. + example: 30 + difference: + type: number + format: double + description: Difference between statement total and expense total (statement_total - expense_total). + example: 15 + matching_issue_count: + type: integer + description: Count of matching issues for transactions in the period. + example: 3 reconciliation_eligible_card_out: type: object additionalProperties: false @@ -30316,6 +36508,7 @@ components: - reconciliation_entry_id - card_number - card_nickname + - is_archived - user - reconciled_on - statement_transaction_count @@ -30324,6 +36517,8 @@ components: - expense_total - matching_issue_count - status + - created_at + - updated_at properties: created_at: $ref: '#/components/schemas/created_at' @@ -30347,6 +36542,10 @@ components: maxLength: 25 description: Unique nickname assigned to the card. example: Business Card + is_archived: + type: boolean + description: Indicate whether the card is archived. + example: false user: $ref: '#/components/schemas/user_out_embed_nullable' reconciled_on: @@ -30385,6 +36584,8 @@ components: updated_at: $ref: '#/components/schemas/updated_at' reconciliation_eligible_cards_stats_in: + required: + - query_params properties: query_params: nullable: false @@ -30395,6 +36596,21 @@ components: example: reconciliation_entry_id=eq.receabc12345 reconciliation_eligible_cards_stats_out: type: object + required: + - period_start + - period_end + - statement_transaction_count + - expense_count + - statement_total + - expense_total + - difference + - matching_issue_count + - total_cards + - card_without_statement_count + - card_with_matching_issue_count + - card_with_no_issues_found_count + - card_with_no_transactions_count + - reconciled_card_count additionalProperties: false properties: period_start: @@ -30446,67 +36662,161 @@ components: type: integer description: Number of cards that have only matching issues. example: 0 + card_with_no_issues_found_count: + type: integer + description: Number of cards that have no matching issues found. + example: 0 + card_with_no_transactions_count: + type: integer + description: Number of cards that have no transactions in the period. + example: 0 reconciled_card_count: type: integer description: Number of cards that are reconciled. example: 0 - reconciliation_transactions_stats_in: + reconciliation_export_config_column_formula: type: object - additionalProperties: false + properties: + function: + type: string + example: Field + parameters: + type: array + items: + anyOf: + - type: object + - type: string + - type: number + - type: integer + - type: boolean description: | - Input to fetch reconciliation transactions stats for a specific card or filter. - Pass filters using the `query_params` string similar to the GET list API. - For example, filter by a single card using `corporate_card_id=eq.`. + Export column formula used to transform the data. + reconciliation_export_config: + type: object + additionalProperties: true + required: + - type + - is_header_visible + - columns + properties: + type: + type: string + enum: + - xlsx + - csv + description: Type of the export file. + example: csv + is_header_visible: + type: boolean + description: Whether to show the header in the export file. + example: true + separate_line_items_entry: + type: object + nullable: true + properties: + enabled: + type: boolean + description: Whether to show the double rows for each line item in the export file. + debit_entries_only: + type: array + items: + type: string + description: Configure which columns to show for debit entries. + credit_entries_only: + type: array + items: + type: string + description: Configure which columns to show for credit entries. + description: Configure how to show the double rows for each line item, if enabled. + columns: + type: array + items: + type: object + properties: + name: + type: string + description: Name of the column. + formula: + $ref: '#/components/schemas/reconciliation_export_config_column_formula' + required: + - name + - formula + description: Configure the columns to show in the export file. + reconciliation_export_in: + type: object + additionalProperties: false + required: + - query_params + - notify_emails + - config properties: query_params: type: string + nullable: false description: | - Query param string similar to reconciliation transactions GET call. Use this to filter the population - before computing stats. For individual card stats, pass `corporate_card_id=eq.`. - example: corporate_card_id=eq.bawownwrng - reconciliation_transactions_stats_out: + Query param string similar to the GET list API for the resource (eligible cards or transactions). + For eligible cards export use e.g. reconciliation_entry_id=eq.. + For transactions export use e.g. reconciliation_entry_id=eq.. + example: reconciliation_entry_id=eq.rece_seed_2 + notify_emails: + type: array + nullable: false + items: + $ref: '#/components/schemas/email' + description: List of emails to notify when the export is ready. + config: + $ref: '#/components/schemas/reconciliation_export_config' + nullable: false + description: Configuration for the export. + reconciliation_export_out: type: object additionalProperties: false - description: | - Reconciliation transactions statistics for the selected filter period. + required: + - id + - org_id + - file_id + - state + - query_params + - notify_emails + - created_at + - updated_at properties: - period_start: + id: + allOf: + - $ref: '#/components/schemas/id_string' + description: Unique id of the export. + org_id: + $ref: '#/components/schemas/org_id' + file_id: + anyOf: + - $ref: '#/components/schemas/null_field' + - $ref: '#/components/schemas/id_string' + nullable: true + description: File id when export is completed (null while pending/processing). + state: type: string - format: date-time - description: Start of the reconciliation period in UTC. - example: '2025-10-01T00:00:00.000+00:00' - period_end: + nullable: false + enum: + - PENDING + - PROCESSING + - SUCCESS + - ERROR + description: Status of the export. + example: PENDING + query_params: type: string - format: date-time - description: End of the reconciliation period in UTC. - example: '2025-10-31T23:59:59.999+00:00' - statement_transaction_count: - type: integer - description: Number of statement transactions considered in the period. - example: 3 - expense_count: - type: integer - description: Number of expenses considered in the period. - example: 2 - statement_total: - type: number - format: double - description: Sum of statement transaction amounts considered in the period. - example: 45 - expense_total: - type: number - format: double - description: Sum of expense amounts considered in the period. - example: 30 - difference: - type: number - format: double - description: Difference between statement total and expense total (statement_total - expense_total). - example: 15 - matching_issue_count: - type: integer - description: Count of matching issues for transactions in the period. - example: 3 + nullable: false + description: Query params used for this export. + notify_emails: + type: array + nullable: false + items: + $ref: '#/components/schemas/email' + description: List of emails to notify when the export is ready. + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' move_to_next_period_from_reconciliation_transaction_in: type: object additionalProperties: false @@ -30523,6 +36833,29 @@ components: spender_employee_settings_out: type: object additionalProperties: false + required: + - id + - employee_id + - org_id + - created_at + - updated_at + - category_ids + - cost_center_ids + - project_ids + - per_diem_rate_ids + - mileage_rate_ids + - insta_fyle_settings + - notification_settings + - mileage_settings + - expense_form_autofills + - data_extractor_settings + - in_app_chat_settings + - payment_mode_settings + - locale + - is_personal_cards_enabled + - default_project_id + - default_payment_mode + - default_vehicle_type properties: id: $ref: '#/components/schemas/id_string' @@ -30660,21 +36993,7 @@ components: example: true description: Whether to notify the delegatee about events mileage_settings: - type: object - nullable: true - additionalProperties: false - description: Settings for mileage tracking and rates - properties: - mileage_rate_labels: - type: object - nullable: true - example: null - description: Labels for different mileage rates - annual_mileage_of_user_before_joining_fyle: - type: object - nullable: true - example: {} - description: Annual mileage limit for user before joining Sage Exp Mgmt + $ref: '#/components/schemas/mileage_settings' expense_form_autofills: type: object nullable: true @@ -30758,20 +37077,24 @@ components: nullable: true additionalProperties: false description: Settings for user's locale and timezone + required: + - timezone + - abbreviation + - offset properties: timezone: type: string - nullable: true + nullable: false example: Asia/Kolkata description: User's timezone abbreviation: type: string - nullable: true + nullable: false example: IST description: Timezone abbreviation offset: type: string - nullable: true + nullable: false example: '05:30:00' description: Timezone offset from UTC is_personal_cards_enabled: @@ -30826,7 +37149,6 @@ components: required: - id - approver_email - - comment properties: id: $ref: '#/components/schemas/id_string' @@ -30870,9 +37192,27 @@ components: type: string description: Reason for sending the advance request back to the spender example: Please provide additional documentation + advance_request_submit_in: + allOf: + - $ref: '#/components/schemas/advance_request_in_base' + - type: object + required: + - currency + - amount advance_request_custom_field_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - type + - options + - is_mandatory + - is_enabled + - placeholder properties: id: type: integer @@ -31196,6 +37536,8 @@ components: example: false corporate_card_transactions_export_configuration_separate_line_items_entry: type: object + required: + - is_enabled properties: is_enabled: type: boolean @@ -31218,6 +37560,12 @@ components: example: [] corporate_card_transactions_export_configuration_column: type: object + required: + - name + - formula + - is_custom + - field_name + - formula_text properties: name: type: string @@ -31253,6 +37601,10 @@ components: example: GET(merchant) corporate_card_transactions_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -31274,6 +37626,11 @@ components: example: desc corporate_card_transactions_export_configuration_config: type: object + required: + - is_header_visible + - separate_line_items_entry + - columns + - date_format additionalProperties: true properties: is_header_visible: @@ -31308,6 +37665,17 @@ components: corporate_card_transactions_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -31394,9 +37762,9 @@ components: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature corporate_card_transactions_export_configuration_in_only_id: type: object required: diff --git a/reference/approver.yaml b/reference/approver.yaml index 6705fe447..d06432234 100644 --- a/reference/approver.yaml +++ b/reference/approver.yaml @@ -25,6 +25,9 @@ tags: - name: Cost Centers description: | These APIs gives you access to manage your organisation's Cost Centers + - name: Corporate Cards + description: | + This API gives you access to view Corporate Cards across organisations where user is approver. - name: Per Diem Rates description: | This API gives you access to manage your organisation's Per Diem Rates @@ -63,6 +66,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -162,6 +169,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_out' @@ -218,6 +227,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_out' @@ -323,6 +334,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_out' @@ -364,6 +377,11 @@ paths: content: application/json: schema: + type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -410,6 +428,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/reports_exports_out' @@ -448,6 +468,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -482,6 +506,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/approver_expense_in' @@ -492,6 +518,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_out' @@ -519,6 +547,63 @@ paths: application/json: schema: $ref: '#/components/schemas/404' + /approver/expenses/bulk: + post: + tags: + - Expenses + summary: Update expenses in bulk + description: | + Update expenses in bulk by approver. + operationId: approver_expenses_post_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/approver_expenses_bulk_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/expense_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' /approver/expenses/attach_files/bulk: post: tags: @@ -549,6 +634,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -602,6 +689,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_permissions_out' @@ -665,6 +754,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_permissions_bulk_out' @@ -746,6 +837,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_out' @@ -793,6 +886,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/report_filters_out' @@ -829,6 +924,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: data: type: array @@ -876,6 +975,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/report_filters_out' @@ -931,6 +1032,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/reports_stats_out' @@ -985,6 +1088,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_comments_out' @@ -1034,6 +1139,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_permissions_out' @@ -1087,6 +1194,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/report_out' @@ -1122,6 +1231,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/subscriptions_in' @@ -1133,6 +1244,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/approver_subscriptions_out' @@ -1188,6 +1301,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1230,6 +1347,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1285,6 +1406,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_requests_approver_stats_out' @@ -1340,6 +1463,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_permissions_out' @@ -1381,6 +1506,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_comments_in' @@ -1391,6 +1518,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_comments_out' @@ -1433,6 +1562,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1469,6 +1602,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1490,6 +1627,61 @@ paths: application/json: schema: $ref: '#/components/schemas/401' + /approver/corporate_cards: + get: + tags: + - Corporate Cards + summary: List corporate cards + description: | + Returns corporate cards from all organisations where user is approver. + + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: corporate_cards_list + parameters: + - $ref: '#/components/parameters/q' + - $ref: '#/components/parameters/created_at' + - $ref: '#/components/parameters/updated_at' + - $ref: '#/components/parameters/order' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/limit' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: array + items: + $ref: '#/components/schemas/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' /approver/cost_centers: get: tags: @@ -1505,6 +1697,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1541,6 +1737,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1584,6 +1784,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1620,6 +1824,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1672,6 +1880,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1758,15 +1970,27 @@ paths: application/json: schema: $ref: '#/components/schemas/404' - /approver/expenses/comments: - get: + /approver/expenses/check_mandatory_fields/bulk: + post: tags: - Expenses - summary: List expense comments - description: List all the comments of an expense - operationId: expense_comments_get - parameters: - - $ref: '#/components/parameters/expense_id' + summary: Check multiple expenses for missing mandatory fields in bulk + description: | + Before updating multiple expense objects as an approver, you can validate + if all mandatory fields are present using this bulk endpoint. + operationId: approver_check_mandatory_fields_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/approver_expense_check_mandatory_fields_bulk_in' responses: '200': description: OK @@ -1774,15 +1998,12 @@ paths: application/json: schema: type: object + additionalProperties: false + required: + - data properties: - count: - $ref: '#/components/schemas/count' - offset: - $ref: '#/components/schemas/offset' data: - type: array - items: - $ref: '#/components/schemas/expense_comments_out' + $ref: '#/components/schemas/expense_check_mandatory_fields_bulk_out' '400': description: Bad request content: @@ -1795,31 +2016,41 @@ paths: application/json: schema: $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/404' - /approver/expenses/comments/bulk: + /approver/expenses/check_policies/bulk: post: tags: - Expenses - - Expense comments - - Comments - summary: Bulk comment on expenses + summary: Check multiple expenses for policy violations in bulk description: | - Bulk comment on expenses as an approver. The API allows you to add comments to multiple expenses at once. - operationId: expense_comments_bulk_post + Approver bulk version of the check_policies API that allows checking + multiple expenses for policy violations in one request. + + **NOTE:** This API can only be used to check policies for existing expenses that you want to update. The API will evaluate all the expenses against the configured policy rules and return an array of policy violation information for each expense in the request payload. + operationId: approver_check_policies_bulk_post requestBody: required: true content: application/json: schema: type: object + additionalProperties: false + required: + - data properties: data: - $ref: '#/components/schemas/expense_comments_bulk_in' + $ref: '#/components/schemas/approver_check_policies_bulk_in' responses: '200': description: OK @@ -1827,11 +2058,12 @@ paths: application/json: schema: type: object + additionalProperties: false + required: + - data properties: data: - type: array - items: - $ref: '#/components/schemas/expense_comments_out' + $ref: '#/components/schemas/expense_check_policies_bulk_out' '400': description: Bad request content: @@ -1839,13 +2071,113 @@ paths: schema: $ref: '#/components/schemas/400' '401': - description: Unauthorized request + description: Unauthorised request content: application/json: schema: $ref: '#/components/schemas/401' - '403': - description: Forbidden + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /approver/expenses/comments: + get: + tags: + - Expenses + summary: List expense comments + description: List all the comments of an expense + operationId: expense_comments_get + parameters: + - $ref: '#/components/parameters/expense_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + $ref: '#/components/schemas/count' + offset: + $ref: '#/components/schemas/offset' + data: + type: array + items: + $ref: '#/components/schemas/expense_comments_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/404' + /approver/expenses/comments/bulk: + post: + tags: + - Expenses + - Expense comments + - Comments + summary: Bulk comment on expenses + description: | + Bulk comment on expenses as an approver. The API allows you to add comments to multiple expenses at once. + operationId: expense_comments_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/expense_comments_bulk_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/expense_comments_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden content: application/json: schema: @@ -1933,6 +2265,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -1978,6 +2312,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expenses_stats_out' @@ -2031,6 +2367,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_filters_out' @@ -2067,6 +2405,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2114,6 +2456,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_filters_out' @@ -2167,6 +2511,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expenses_exports_out' @@ -2202,6 +2548,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/admin_split_expense_in' @@ -2212,6 +2560,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -2258,6 +2608,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/admin_split_expense_in' @@ -2268,6 +2620,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -2313,6 +2667,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/admin_split_expense_in' @@ -2323,6 +2679,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -2382,6 +2740,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -2458,6 +2818,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -2604,6 +2966,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2641,6 +3007,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2746,6 +3116,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -2789,6 +3161,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_add_approver_in' @@ -2804,6 +3178,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -2873,6 +3249,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -2985,6 +3363,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -3041,7 +3421,7 @@ paths: - data properties: data: - $ref: '#/components/schemas/advance_request_in' + $ref: '#/components/schemas/advance_request_submit_in' responses: '200': description: OK @@ -3050,6 +3430,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -3102,6 +3484,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_custom_fields_out' @@ -3163,6 +3547,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -3207,6 +3593,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -3261,6 +3649,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: data: type: array @@ -3339,6 +3731,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/employee_overview_stats_out' @@ -3395,6 +3789,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3466,6 +3864,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/employee_overview_expense_stats_out' @@ -3513,6 +3913,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3650,6 +4054,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expenses_export_configuration_out' @@ -3781,6 +4187,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3843,6 +4253,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/reports_export_configuration_out' @@ -3961,7 +4373,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions @@ -4049,6 +4461,10 @@ components: user_out_embed: type: object additionalProperties: false + required: + - id + - email + - full_name properties: id: allOf: @@ -4076,13 +4492,34 @@ components: report_approval_out_embed: type: object additionalProperties: false + required: + - approver_user_id + - approver_user + - state properties: approver_user_id: allOf: - $ref: '#/components/schemas/id_string' + nullable: true + description: | + The user ID of the approver. This is null when approver_type is SYSTEM (auto-approval). example: usge49ielgel + approver_type: + type: string + enum: + - USER + - SYSTEM + description: | + Type of approver. + - USER: A human approver identified by approver_user_id + - SYSTEM: Automatic approval by the system (auto-approval feature). When approver_type is SYSTEM, approver_user_id is null. + example: USER approver_user: - $ref: '#/components/schemas/user_out_embed' + allOf: + - $ref: '#/components/schemas/user_out_embed' + nullable: true + description: | + The user object of the approver. This is null when approver_type is SYSTEM. state: type: string enum: @@ -4138,6 +4575,12 @@ components: type: object additionalProperties: false nullable: true + required: + - id + - code + - name + - sub_department + - display_name properties: id: $ref: '#/components/schemas/id_string' @@ -4214,6 +4657,18 @@ components: employee_out_embed_for_report: type: object additionalProperties: false + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department + - ach_account + - business_unit + - location + - title properties: id: $ref: '#/components/schemas/id_string' @@ -4357,6 +4812,12 @@ components: reimbursement_out_minimal: type: object nullable: true + required: + - id + - currency + - amount + - mode + - ach_transfer properties: id: type: string @@ -4383,6 +4844,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - email + - full_name properties: id: allOf: @@ -4426,6 +4891,9 @@ components: advance_wallet_report_out: type: object additionalProperties: false + required: + - id + - amount properties: id: allOf: @@ -4463,6 +4931,16 @@ components: - reimbursement_id - reimbursement - comments + - creator_type + - is_verified + - is_physical_bill_submitted + - physical_bill_submitted_at + - is_exported + - employee_id + - state_display_name + - accounting_export_summary + - applied_advance_wallets + - auto_approval_state properties: id: $ref: '#/components/schemas/id_string' @@ -4662,6 +5140,23 @@ components: nullable: true description: | List of applied advance wallets + creator_type: + type: string + enum: + - USER + - SYSTEM + description: | + Indicates whether the report was created by a user or the system. + example: USER + auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null approver_report_in: type: object additionalProperties: false @@ -4758,6 +5253,9 @@ components: example: state=eq.PAID reports_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -4783,6 +5281,8 @@ components: reports_export_config: type: object additionalProperties: true + required: + - type properties: type: type: string @@ -4805,6 +5305,10 @@ components: example: true separate_line_items_entry: type: object + required: + - enabled + - debit_entries_only + - credit_entries_only properties: enabled: type: boolean @@ -4833,6 +5337,9 @@ components: type: array items: type: object + required: + - name + - formula properties: name: type: string @@ -4849,6 +5356,17 @@ components: reports_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - file_id + - state + - query_params + - notify_emails + - config properties: created_at: $ref: '#/components/schemas/created_at' @@ -4944,6 +5462,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -4959,7 +5481,14 @@ components: type: object nullable: true additionalProperties: false - properties: + required: + - id + - system_category + - name + - sub_category + - code + - display_name + properties: id: $ref: '#/components/schemas/id_integer' system_category: @@ -4990,6 +5519,12 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - sub_project + - code + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -5021,6 +5556,9 @@ components: example: sdfd2391 account_out_embed: type: object + required: + - id + - type properties: id: allOf: @@ -5040,6 +5578,11 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - vehicle_type + - code + - rate properties: id: $ref: '#/components/schemas/id_integer' @@ -5053,10 +5596,66 @@ components: example: 10 nullable: true description: Amount (in Home currency) per unit. + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Vehicle ownership for advanced mileage rates. `null` for basic mileage rates. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Vehicle category for advanced mileage rates. `null` for basic mileage rates. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Fuel type for advanced car mileage rates. `null` otherwise. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Engine capacity band for petrol, diesel, and LPG advanced car rates. An empty object for basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Charging location for advanced electric car mileage rates. `null` otherwise. per_diem_rate_out_embed: type: object nullable: true additionalProperties: false + required: + - id + - name + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -5200,6 +5799,9 @@ components: - last_paid_at - reimbursement_id - reimbursement_seq_num + - amount + - last_verified_at + - approvals properties: id: anyOf: @@ -5288,6 +5890,11 @@ components: List of report_approval objects file_out_embed: type: object + required: + - id + - name + - type + - content_type properties: id: allOf: @@ -5323,6 +5930,9 @@ components: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string @@ -5330,6 +5940,9 @@ components: expense_verification_out_embed: type: object additionalProperties: false + required: + - verifier_user_id + - verifier_user properties: verifier_user_id: allOf: @@ -5370,6 +5983,19 @@ components: type: object additionalProperties: false nullable: true + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department + - location + - title + - business_unit + - custom_fields + - flattened_custom_field properties: id: $ref: '#/components/schemas/id_string' @@ -5484,6 +6110,21 @@ components: - id - corporate_card_id - corporate_card_number + - corporate_card_nickname + - masked_corporate_card_number + - bank_name + - corporate_card_user_full_name + - amount + - currency + - spent_at + - posted_at + - status + - description + - foreign_currency + - foreign_amount + - merchant + - category + - matched_by properties: id: allOf: @@ -5528,6 +6169,11 @@ components: description: | String denoting the card holder's full name example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false amount: $ref: '#/components/schemas/amount' currency: @@ -5590,6 +6236,128 @@ components: description: | String denoting the email of the user who matched the card transaction to an expense. example: john.ooe@sage.com + matched_corporate_card_transaction_out_embed_new: + anyOf: + - type: object + additionalProperties: false + properties: {} + description: Empty object when no corporate card transaction is matched + - type: object + required: + - id + - corporate_card_id + - corporate_card_number + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: btxnwownwrng + corporate_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + corporate_card_number: + $ref: '#/components/schemas/card_number' + corporate_card_nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: Business Card + corporate_card_cardholder_name: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the card holder's name + example: John Cena + capitalone_virtual_card_last_four: + type: string + nullable: true + description: | + Last four digits of capitalone virtual card. + example: '4521' + masked_corporate_card_number: + $ref: '#/components/schemas/card_number' + bank_name: + nullable: true + $ref: '#/components/schemas/bank_name' + corporate_card_user_full_name: + nullable: true + allOf: + - $ref: '#/components/schemas/name_nullable' + maxLength: 255 + description: | + String denoting the card holder's full name + example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false + amount: + $ref: '#/components/schemas/amount' + currency: + $ref: '#/components/schemas/currency' + spent_at: + allOf: + - $ref: '#/components/schemas/spent_at' + description: | + Signifies spent date of a card transaction. + This date cannot be in future. + posted_at: + nullable: true + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies post date of a card transaction. + This date cannot be in future. + status: + type: string + nullable: true + enum: + - PENDING + - POSTED + - null + example: PENDING + description: | + Signifies status of a card transaction. + description: + type: string + nullable: true + description: | + Holds the description of the card transaction + example: Team lunch + foreign_currency: + nullable: true + allOf: + - $ref: '#/components/schemas/foreign_currency' + foreign_amount: + nullable: true + allOf: + - $ref: '#/components/schemas/foreign_amount' + merchant: + nullable: true + allOf: + - $ref: '#/components/schemas/merchant' + description: | + String denoting the name of the vendor to which the card transaction was made. + Note: This is not same as the merchant added in Sage Exp Mgmt but just a string + category: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the category of the card transaction + Note: This is not same as the category added in Sage Exp Mgmt but just a string + example: Travel + matched_by: + type: string + nullable: true + description: | + String denoting the email of the user who matched the card transaction to an expense. + example: john.ooe@sage.com missing_mandatory_fields: type: object nullable: false @@ -5841,6 +6609,12 @@ components: example: 77.594566 commute_details: type: object + required: + - id + - distance + - distance_unit + - home_location + - work_location nullable: true description: | Commute details of the employee. This is used to deduct daily commute from the employee's mileage expenses. @@ -5909,12 +6683,18 @@ components: - source_account - tax_amount - tax_group_id + - calculated_tax_amount - is_billable - is_reimbursable - distance - distance_unit - mileage_calculated_distance - mileage_calculated_amount + - selected_vehicle_ownership + - selected_vehicle_category + - passenger_count + - passenger_mileage_rate + - passenger_amount - mileage_rate_id - mileage_rate - mileage_is_round_trip @@ -5933,6 +6713,7 @@ components: - seq_num - report_id - added_to_report_at + - added_to_report_by - report - is_verified - last_verified_at @@ -5945,6 +6726,8 @@ components: - is_corporate_card_transaction_auto_matched - matched_corporate_card_transaction_ids - matched_corporate_card_transactions + - matched_corporate_card_transaction_id + - matched_corporate_card_transaction - last_settled_at - missing_mandatory_fields - activity_details @@ -5958,6 +6741,26 @@ components: - invoice_number - is_duplicate_present - expense_policy_comments + - custom_fields_flattened + - approvals + - verifications + - employee_id + - split_group_amount + - expense_rule_id + - expense_rule_data + - is_split + - tax_group + - approver_comments + - verifier_comments + - policy_checks + - accounting_export_summary + - report_last_paid_at + - report_last_approved_at + - commute_deduction + - commute_details_id + - commute_details + - is_reconciled + - report_auto_approval_state properties: id: allOf: @@ -6080,6 +6883,12 @@ components: allOf: - $ref: '#/components/schemas/fk_string' nullable: true + calculated_tax_amount: + type: number + nullable: true + readOnly: true + description: | + System-derived tax amount for the expense amount and the selected tax group's rate. is_billable: type: boolean nullable: true @@ -6110,6 +6919,36 @@ components: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + selected_vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Selected vehicle ownership for an advanced mileage expense. `null` for a basic mileage expense. + selected_vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Selected vehicle category for an advanced mileage expense. `null` for a basic mileage expense. + passenger_count: + type: integer + nullable: true + description: Number of passengers carried on the mileage journey. + passenger_mileage_rate: + type: number + nullable: true + readOnly: true + description: Passenger mileage rate snapshot applied to this expense. `null` when passenger mileage does not apply. + passenger_amount: + type: number + nullable: true + description: Passenger mileage reimbursement amount for this expense. mileage_rate_id: allOf: - $ref: '#/components/schemas/fk_integer' @@ -6213,6 +7052,16 @@ components: description: | signifies when this expense was added to a report. If this expense is not added to a report, then this could be null. + added_to_report_by: + type: string + nullable: true + enum: + - USER + - SYSTEM + - null + description: | + Indicates whether the expense was added to the report it belongs to by a user or the system. If the expense is not a part of any report, this field will be null. + example: USER report: $ref: '#/components/schemas/report_out_embed' is_verified: @@ -6285,6 +7134,8 @@ components: $ref: '#/components/schemas/id_string' description: | Holds the corporate card transaction ids which are matched to this expense + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction_id` instead, as this array always contains a single value. example: - btxnwownwrng matched_corporate_card_transactions: @@ -6294,6 +7145,20 @@ components: description: | Holds the corporate card transactions which are matched to this expense. NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_ids` is already up-to-date. + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction` instead, as this array always contains a single value. + matched_corporate_card_transaction_id: + type: string + nullable: true + description: | + Holds the corporate card transaction id which is matched to this expense + example: btxnwownwrng + matched_corporate_card_transaction: + allOf: + - $ref: '#/components/schemas/matched_corporate_card_transaction_out_embed_new' + description: | + Holds the corporate card transaction which is matched to this expense. + NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_id` is already up-to-date. last_settled_at: allOf: - $ref: '#/components/schemas/timestamptz_utc' @@ -6462,6 +7327,15 @@ components: description: | Whether expenses is reconciled or not. example: true + report_auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the expense's report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null source: type: string description: | @@ -6559,7 +7433,7 @@ components: description: | The expense amount which is added or modified by admin or approver. - **Note:** - - _This field is non-nullable_. + - _This field is non-nullable_. example: 1900 spent_at: type: string @@ -6569,7 +7443,7 @@ components: It signifies when this expense was made. This date cannot be in future. - **Note:** - - _This field is non-nullable_. + - _This field is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' source: $ref: '#/components/schemas/source' @@ -6662,6 +7536,16 @@ components: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. commute_details_id: type: integer nullable: true @@ -6696,24 +7580,7 @@ components: description: | Specific to per diem related expenses, number of days for which per diem claim is made.
This field is required for creating Per Diem Expenses. - attach_files_to_expense_in: - type: object - required: - - id - - file_ids - properties: - id: - allOf: - - $ref: '#/components/schemas/id_string' - example: txsjfwlrglw - file_ids: - type: array - items: - $ref: '#/components/schemas/id_string' - example: - - figwiwpjww - description: List of files to be attached to the expense - expense_permissions_in: + items: type: object required: - id @@ -6722,48 +7589,169 @@ components: allOf: - $ref: '#/components/schemas/id_string' description: | - Expense ID of the expense to check permissions for. - example: tx0agOdICdbV - expense_permissions_out: - type: object - required: - - can_delete - - can_edit - - can_verify - - can_remove_from_report - - can_assign - - can_add_to_report - properties: - can_delete: - type: boolean - description: | - Indicates whether the user has permission to delete this expense. - example: false - can_edit: - type: boolean + Expense id of the expense to be updated. + example: txwownwrng + merchant: + $ref: '#/components/schemas/merchant' + nullable: true description: | - Indicates whether the user has permission to edit this expense. - example: true - can_verify: - type: boolean + String denoting the name of the merchant to which the expense was made. + example: Uber + purpose: + type: string + nullable: true description: | - Indicates whether the user has permission to verify this expense. - example: true - can_remove_from_report: - type: boolean + Purpose of this expense. + example: Team lunch + cost_center_id: + allOf: + - $ref: '#/components/schemas/fk_integer' + nullable: true description: | - Indicates whether the user has permission to remove this expense from a report. - example: false - can_assign: - type: boolean + This represents the cost_center's id given by Sage Exp Mgmt during creation of cost center + for which this expense is created. + example: 1049 + category_id: + allOf: + - $ref: '#/components/schemas/fk_integer' + nullable: false description: | - Indicates whether the user has permission to assign this expense to another user. - example: false - can_add_to_report: - type: boolean + This represents the category's id given by Sage Exp Mgmt during creation of category + for which this expense is created. + example: 49058 + project_id: + allOf: + - $ref: '#/components/schemas/fk_integer' + nullable: true description: | - Indicates whether the user has permission to add this expense to a report. - example: true + This represents the project's id given by Sage Exp Mgmt during creation of project + for which this expense is created. + example: 92895 + is_billable: + $ref: '#/components/schemas/is_billable' + nullable: true + description: This fields marks whether a given expense is billable or not. + example: true + custom_fields: + $ref: '#/components/schemas/custom_fields' + nullable: false + started_at: + $ref: '#/components/schemas/timestamptz_pst' + nullable: true + description: | + Start date for travel or per diem related expenses. + ended_at: + $ref: '#/components/schemas/timestamptz_pst' + nullable: true + description: | + End date for travel or per diem related expenses. + travel_classes: + $ref: '#/components/schemas/travel_classes' + nullable: false + description: | + This field is applicable only for `Flight`, `Train`, `Bus`, `Taxi` category. + index 0 holds onward journey class, index 1 holds return journey travel class. + example: + - ECONOMY + - BUSINESS + locations: + $ref: '#/components/schemas/locations' + nullable: false + description: | + This field will be present for travel related categories. + For travel between Place A to Place B, this array will contain two items, From location at array index 0 and To location at array index 1. + distance: + $ref: '#/components/schemas/distance' + nullable: true + description: Actual distance travelled by employee in travel related expenses. + distance_unit: + enum: + - KM + - MILES + - null + nullable: true + description: Unit of distance travelled. + example: MILES + hotel_is_breakfast_provided: + type: boolean + nullable: true + description: | + This field is applicable for only `Hotel` category. + approver_expenses_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be updated in bulk by the approver. + items: + $ref: '#/components/schemas/items' + attach_files_to_expense_in: + type: object + required: + - id + - file_ids + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: txsjfwlrglw + file_ids: + type: array + items: + $ref: '#/components/schemas/id_string' + example: + - figwiwpjww + description: List of files to be attached to the expense + expense_permissions_in: + type: object + required: + - id + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + description: | + Expense ID of the expense to check permissions for. + example: tx0agOdICdbV + expense_permissions_out: + type: object + required: + - can_delete + - can_edit + - can_verify + - can_remove_from_report + - can_assign + - can_add_to_report + properties: + can_delete: + type: boolean + description: | + Indicates whether the user has permission to delete this expense. + example: false + can_edit: + type: boolean + description: | + Indicates whether the user has permission to edit this expense. + example: true + can_verify: + type: boolean + description: | + Indicates whether the user has permission to verify this expense. + example: true + can_remove_from_report: + type: boolean + description: | + Indicates whether the user has permission to remove this expense from a report. + example: false + can_assign: + type: boolean + description: | + Indicates whether the user has permission to assign this expense to another user. + example: false + can_add_to_report: + type: boolean + description: | + Indicates whether the user has permission to add this expense to a report. + example: true expense_permissions_bulk_in: type: array maxItems: 200 @@ -6849,6 +7837,16 @@ components: report_filters_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - is_shared + - name + - org_id + - query_string + - user_id + - sub_feature properties: id: allOf: @@ -6896,6 +7894,8 @@ components: - $ref: '#/components/schemas/id_string' example: rpfilumWHrlPf7K reports_stats_in: + required: + - query_params properties: query_params: type: string @@ -7169,6 +8169,13 @@ components: approver_subscriptions_out: type: object additionalProperties: false + required: + - id + - is_enabled + - webhook_url + - updated_at + - created_at + - approver_user_id properties: id: $ref: '#/components/schemas/id_string' @@ -7225,6 +8232,12 @@ components: advance_out_embed: type: object nullable: true + required: + - id + - currency + - amount + - advance_request_id + - seq_num properties: id: type: string @@ -7253,6 +8266,11 @@ components: type: object description: | Advance request custom field + required: + - id + - name + - type + - value properties: name: type: string @@ -7300,6 +8318,10 @@ components: advance_request_approval_out_embed: type: object additionalProperties: false + required: + - approver_user_id + - approver_user + - state properties: approver_user_id: allOf: @@ -7316,9 +8338,39 @@ components: - APPROVAL_REJECTED description: | State of this advance request approval + department_out_employee_embed: + type: object + additionalProperties: false + nullable: true + required: + - id + - code + - name + - sub_department + properties: + id: + $ref: '#/components/schemas/id_string' + code: + $ref: '#/components/schemas/code' + name: + allOf: + - $ref: '#/components/schemas/name' + example: Sales + sub_department: + type: string + nullable: true + example: Outbound Sales employee_out_embed: type: object additionalProperties: false + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department properties: id: $ref: '#/components/schemas/id_string' @@ -7341,7 +8393,7 @@ components: $ref: '#/components/schemas/department_id' department: nullable: true - $ref: '#/components/schemas/department_out_embed' + $ref: '#/components/schemas/department_out_employee_embed' user_id_nullable: type: string description: | @@ -7349,9 +8401,16 @@ components: readOnly: true nullable: true example: uswjwgnwwgo - advance_request_comments_out: + advance_request_comments_out_embed: type: object additionalProperties: false + required: + - id + - comment + - creator_type + - creator_user_id + - creator_user + - created_at properties: id: $ref: '#/components/schemas/id_string' @@ -7359,12 +8418,6 @@ components: type: string description: A comment on the advance request example: Advance request was created - action: - type: string - description: Advance request action for which comment is added. - example: SUBMITTED - advance_request_id: - $ref: '#/components/schemas/id_string' creator_type: type: string description: Describes whether the comment is system-generated or User made. @@ -7379,13 +8432,37 @@ components: $ref: '#/components/schemas/user_out_embed_nullable' created_at: $ref: '#/components/schemas/created_at' - updated_at: - $ref: '#/components/schemas/updated_at' - org_id: - $ref: '#/components/schemas/org_id' advance_request_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - user_id + - org_id + - project_id + - advance_id + - seq_num + - currency + - amount + - last_approved_at + - notes + - purpose + - source + - state + - custom_fields + - user + - project + - advance + - approvals + - is_exported + - employee_id + - employee + - code + - comments + - file_ids + - files properties: id: allOf: @@ -7484,7 +8561,7 @@ components: comments: type: array items: - $ref: '#/components/schemas/advance_request_comments_out' + $ref: '#/components/schemas/advance_request_comments_out_embed' description: | List of comments in the advance request file_ids: @@ -7498,6 +8575,8 @@ components: items: $ref: '#/components/schemas/file_out_embed' advance_requests_approver_stats_in: + required: + - query_params properties: query_params: description: | @@ -7565,6 +8644,18 @@ components: advance_request_permissions_out: type: object additionalProperties: false + required: + - can_save + - can_submit + - can_edit + - can_add_approver + - can_disable_approver + - can_reject + - can_approve + - can_inquire + - can_pull_back + - can_pay + - can_delete properties: can_save: type: boolean @@ -7625,37 +8716,82 @@ components: type: string description: Comment text to be added to the advance request example: test - description: - type: string - nullable: true - maxLength: 255 - description: | - This represents the description of the resource. - example: Win the trophy - restricted_spender_user_ids: - type: array - nullable: true - items: - type: string - nullable: true - maxLength: 15 - description: | - This id is provided by Sage Exp Mgmt to identify an object. - example: uswoirwlwwg - example: - - uswoirwlwwg - - uswlgwkgw42 - description: | - List of IDs of users who can access this object. - approver_user_ids: - type: array - nullable: false - maxItems: 2 - items: - type: string - nullable: true - maxLength: 15 - description: | + advance_request_comments_out: + type: object + additionalProperties: false + required: + - id + - comment + - action + - advance_request_id + - creator_type + - creator_user_id + - creator_user + - created_at + - updated_at + - org_id + properties: + id: + $ref: '#/components/schemas/id_string' + comment: + type: string + description: A comment on the advance request + example: Advance request was created + action: + type: string + description: Advance request action for which comment is added. + example: SUBMITTED + advance_request_id: + $ref: '#/components/schemas/id_string' + creator_type: + type: string + description: Describes whether the comment is system-generated or User made. + enum: + - SYSTEM + - POLICY + - USER + example: USER + creator_user_id: + $ref: '#/components/schemas/user_id_nullable' + creator_user: + $ref: '#/components/schemas/user_out_embed_nullable' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + org_id: + $ref: '#/components/schemas/org_id' + description: + type: string + nullable: true + maxLength: 255 + description: | + This represents the description of the resource. + example: Win the trophy + restricted_spender_user_ids: + type: array + nullable: true + items: + type: string + nullable: true + maxLength: 15 + description: | + This id is provided by Sage Exp Mgmt to identify an object. + example: uswoirwlwwg + example: + - uswoirwlwwg + - uswlgwkgw42 + description: | + List of IDs of users who can access this object. + approver_user_ids: + type: array + nullable: false + maxItems: 2 + items: + type: string + nullable: true + maxLength: 15 + description: | This id is provided by Sage Exp Mgmt to identify an object. example: uswoirwlwwg example: @@ -7666,6 +8802,22 @@ components: admin_approver_project_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - sub_project + - display_name + - is_enabled + - code + - description + - restricted_spender_user_ids + - approver_user_ids + - approver_users + - category_ids + - default_billable properties: id: $ref: '#/components/schemas/id_integer' @@ -7717,9 +8869,28 @@ components: type: integer example: 16570 description: List of categories that are applicable for the project. + default_billable: + type: boolean + nullable: true + description: | + Default billable flag for expenses using this project. + `null` indicates the default is not set. admin_approver_category_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - display_name + - code + - is_enabled + - name + - sub_category + - system_category + - restricted_project_ids + - restricted_spender_user_ids properties: id: $ref: '#/components/schemas/id_integer' @@ -7768,9 +8939,225 @@ components: List of project ids for which this category can be used. If project_ids is null, then this category can be used for any project. restricted_spender_user_ids: $ref: '#/components/schemas/restricted_spender_user_ids' + corporate_card_out: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + org_id: + $ref: '#/components/schemas/org_id' + user_id: + type: string + maxLength: 255 + nullable: true + description: | + The unique id of an user to whom the card is assigned + example: uswjwgnwwgo + user: + $ref: '#/components/schemas/user_out_embed_nullable' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + bank_name: + $ref: '#/components/schemas/bank_name' + card_number: + $ref: '#/components/schemas/card_number' + cardholder_name: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the card holder's name + example: John Cena + data_feed_source: + type: string + nullable: true + description: | + signifies the source of how card is added and how further card transactions could be synced + example: BANK FEED - CDF + code: + type: string + nullable: true + description: | + Id given by external systems like Gmail. To identify whether that entity + has been already added to Sage Exp Mgmt or not. + example: wgjwgo3ihwljnlsww + yodlee_account_id: + type: string + nullable: true + description: | + Identifier for the linked Yodlee account. + example: yac2cqC4eSaS6 + last_synced_at: + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + nullable: true + description: | + Signifies when this card was last synced. + last_assigned_at: + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + nullable: true + description: | + Signifies when this card was last assigned. + assignor_user_id: + type: string + description: | + The unique id of an user who assigned the card. + nullable: true + example: uswjwgnwwgo + is_visa_enrolled: + type: boolean + description: | + If the card is enrolled with real time feed from visa + nullable: false + is_mastercard_enrolled: + type: boolean + description: | + If the card is enrolled with realtime feed from Mastercard + nullable: false + is_capitalone_enrolled: + type: boolean + description: | + If the card is enrolled with realtime feed from Capital One + nullable: true + is_dummy: + type: boolean + description: | + If the card is a test card + nullable: false + last_ready_for_verification_at: + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies when the card was ready to be verified + example: '2022-02-01T07:20:30.951475+00:00' + nullable: true + last_verification_attempt_at: + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies when the last card verification was attempted + nullable: true + last_verified_at: + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies when the card was verified + example: '2022-02-01T07:20:39.207250+00:00' + nullable: true + verification_status: + type: string + nullable: false + description: | + Verification status of the corporate card + enum: + - VERIFIED + - NOT_VERIFIED + - READY_FOR_VERIFICATION + virtual_card_id: + type: string + description: | + The unique id of the virtual card, if the card is created from virtual card. + nullable: true + example: viasdfasdfddd + virtual_card_state: + type: string + description: | + Status of the virtual card + nullable: true + enum: + - ACTIVE + - PREACTIVE + - INACTIVE + - EXPIRED + - DELETED + - USED + - null + example: ACTIVE + nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: Business Card + is_archived: + type: boolean + description: | + Indicates whether the corporate card is archived. + nullable: false + archived_at: + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies when the card was archived + example: '2022-02-01T07:20:39.207250+00:00' + nullable: true + archived_by_user_id: + type: string + description: | + The unique id of an user who archived the card. + nullable: true + total_transactions_count: + type: integer + nullable: false + description: | + The total number of transactions for the card, in Sage Exp Mgmt + example: 100 + unassigned_transactions_count: + type: integer + nullable: false + description: | + The total number of unassigned transactions for the card, in Sage Exp Mgmt + example: 50 + required: + - id + - org_id + - user_id + - user + - created_at + - updated_at + - bank_name + - card_number + - cardholder_name + - data_feed_source + - code + - yodlee_account_id + - last_synced_at + - last_assigned_at + - assignor_user_id + - is_visa_enrolled + - is_mastercard_enrolled + - is_capitalone_enrolled + - is_dummy + - last_ready_for_verification_at + - last_verification_attempt_at + - last_verified_at + - verification_status + - virtual_card_id + - virtual_card_state + - nickname + - archived_at + - archived_by_user_id + - total_transactions_count + - unassigned_transactions_count approver_cost_center_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - is_enabled + - code + - description + - restricted_spender_user_ids properties: id: $ref: '#/components/schemas/id_integer' @@ -7797,6 +9184,17 @@ components: per_diem_rate_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - is_enabled + - name + - currency + - rate + - code + - description properties: id: $ref: '#/components/schemas/id_integer' @@ -7828,6 +9226,12 @@ components: approver_merchant_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -7845,6 +9249,22 @@ components: mileage_rate_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - unit + - vehicle_type + - rate + - slab_rates + - is_enabled + - code + - vehicle_ownership + - vehicle_category + - fuel_type + - engine_capacity + - charging_location properties: id: $ref: '#/components/schemas/id_integer' @@ -7871,6 +9291,9 @@ components: type: array items: type: object + required: + - rate + - limit properties: rate: type: number @@ -7882,6 +9305,58 @@ components: $ref: '#/components/schemas/is_enabled' code: $ref: '#/components/schemas/code' + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Vehicle ownership for advanced mileage rates. `null` for basic mileage rates. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Vehicle category for advanced mileage rates. `null` for basic mileage rates. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Fuel type for advanced car mileage rates. `null` otherwise. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Engine capacity band for petrol, diesel, and LPG advanced car rates. An empty object for basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Charging location for advanced electric car mileage rates. `null` otherwise. expense_policy_rule_embed: type: object additionalProperties: false @@ -7901,6 +9376,11 @@ components: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: true + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false @@ -7942,6 +9422,11 @@ components: example: eq.ouNSnadfaLA expense_policy_expenses_query_object: type: object + required: + - limit_start_date + - limit_end_date + - params + nullable: true description: | An expense may be violating an expense policy rule due to a group of other expenses. These query params can be used to fetch those expenses because of which this expense is causing a violation.
@@ -7952,6 +9437,7 @@ components: description: | Spend start date query param to find the list of violating expenses. example: '2021-12-01' + nullable: true limit_end_date: type: string description: | @@ -7961,6 +9447,17 @@ components: $ref: '#/components/schemas/expense_policy_expenses_query_object_params' expense_policy_individual_desired_states: type: object + required: + - add_approver_user_ids + - approver_policy_order + - approver_source + - expense_id + - expense_policy_rule_id + - expense_policy_rule + - run_status + - run_result + - amount + - expenses_query_object properties: add_approver_user_ids: nullable: true @@ -8031,7 +9528,7 @@ components: description: | This represents the id of the expense policy rule. example: tprabsdfSYqd - rule: + expense_policy_rule: $ref: '#/components/schemas/expense_policy_rule_embed' amount: nullable: true @@ -8041,11 +9538,21 @@ components: description: | Amount that the policy calculation suggests for this expense. example: 500 - expenses_query_object_params: + expenses_query_object: nullable: true $ref: '#/components/schemas/expense_policy_expenses_query_object' expense_policy_final_desired_state: type: object + required: + - expense_id + - flag + - amount + - unreportable + - is_receipt_mandatory + - add_approver_user_ids + - remove_employee_approver1 + - run_status + - run_summary properties: expense_id: type: string @@ -8112,6 +9619,10 @@ components: expense_policy_states_out: type: object additionalProperties: false + required: + - expense_id + - individual_desired_states + - final_desired_state properties: expense_id: type: string @@ -8207,6 +9718,16 @@ components: $ref: '#/components/schemas/distance' distance_unit: $ref: '#/components/schemas/distance_unit' + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. started_at: $ref: '#/components/schemas/timestamptz_pst' ended_at: @@ -8225,60 +9746,296 @@ components: invoice_number: type: string nullable: true - maxLength: 255 + maxLength: 255 + description: | + Invoice number of the expense. + example: 123456 + expense_check_mandatory_fields_in: + required: + - id + properties: + id: + $ref: '#/components/schemas/id_string' + spent_at: + $ref: '#/components/schemas/spent_at' + claim_amount: + $ref: '#/components/schemas/claim_amount' + allOf: + - $ref: '#/components/schemas/spender_expense_check_mandatory_fields_in' + expense_check_mandatory_fields_out: + type: object + additionalProperties: false + required: + - missing_amount + - missing_currency + - missing_receipt + - missing_expense_field_ids + properties: + missing_amount: + type: boolean + description: | + If this is set to true, then you need to send amount field with expense object. + example: false + missing_currency: + type: boolean + description: | + If this is set to true, then you need to send currency field with expense object. + example: false + missing_receipt: + type: boolean + description: | + If this is set to true, then you need to attach receipt to the expense. + example: false + missing_expense_field_ids: + type: array + nullable: false + items: + type: integer + nullable: true + description: | + This id provided by Sage Exp Mgmt to identify an expense field. + example: 123 + example: + - 123 + - 12423 + description: | + List of IDs of expense fields which are mandatory but are missing. + approver_expense_check_mandatory_fields_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be checked for missing mandatory fields by approver. + items: + $ref: '#/components/schemas/items' + expense_check_mandatory_fields_bulk_out: + type: array + additionalProperties: false + items: + type: object + required: + - id + - missing_amount + - missing_currency + - missing_receipt + - missing_expense_field_ids + properties: + id: + $ref: '#/components/schemas/id_string' + example: tx0agOdICdbV + missing_amount: + type: boolean + description: | + If this is set to true, then you need to send amount field with expense object. + example: false + missing_currency: + type: boolean + description: | + If this is set to true, then you need to send currency field with expense object. + example: false + missing_receipt: + type: boolean + description: | + If this is set to true, then you need to attach receipt to the expense. + example: false + missing_expense_field_ids: + type: array + nullable: false + items: + type: integer + nullable: true + description: | + This id provided by Sage Exp Mgmt to identify an expense field. + example: 123 + example: + - 123 + - 12423 + description: | + List of IDs of expense fields which are mandatory but are missing. + approver_check_policies_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be validated against expense policy rules by approver. + items: + $ref: '#/components/schemas/items' + expense_check_policies_individual_desired_states: + type: object + required: + - add_approver_user_ids + - approver_policy_order + - approver_source + - expense_policy_rule_id + - expense_policy_rule + - run_status + - run_result + - amount + - expenses_query_object + properties: + add_approver_user_ids: + nullable: true + type: array + items: + type: string + description: | + List of approver ids that the policy calculation suggests adding to report that contains this expense. + example: + - usBdsdfscl + - usLSsdfwqt + approver_policy_order: + type: integer + nullable: true + description: | + This represents the order of the approver policy related to this individual desired state record. + If the policy does not add any approver, this field will be null. + example: 1 + approver_source: + type: string + enum: + - PRIMARY_APPROVER + - SECONDARY_APPROVER_1 + - SECONDARY_APPROVER_2 + - PROJECT_APPROVER_1 + - PROJECT_APPROVER_2 + - DEPARTMENT_HEAD_APPROVER + - EMAIL_APPROVER + - null + nullable: true + description: | + This represents the type of approver(source) that was added by the approver policy related to this individual + desired state record. If the policy does not add any approver, this field will be null. + example: PROJECT_APPROVER_1 + expense_policy_rule_id: + type: string + description: | + This represents the id of the expense policy rule. + example: tprabsdfSYqd + expense_policy_rule: + $ref: '#/components/schemas/expense_policy_rule_embed' + run_status: + nullable: false + type: string + enum: + - VIOLATED_ACTION_SUCCESS + - VIOLATED_ACTION_FAILURE + - UNVIOLATED + description: | + This represents the status of policy computation for the input expense object against the policy represented by `expense_policy_rule_id`. + If the state is `UNVIOLATED`, it means that the expense is not violating this policy. If the state is `VIOLATION_ACTION_SUCCESS`, + it means that the expense is violating this policy and action stated in the object will be applied to the expense when it is saved. + However, if the state is `VIOLATION_ACTION_FAILURE`, it means that this policy is violated for the expense but since some approver was + missing or not set up properly, it will fail to take action on the expense when it is saved. + example: SUCCESS + run_result: + type: array + items: + type: string + description: | + List of human-readable action summaries that the policy calculation suggests for this expense. Note that, in + case some approver was not setup properly for the given violation, this array will contain description of + missing approvers. For example, Department approver, Project head, etc. + example: + - flag the expense + - cap the amount + amount: + nullable: true + anyOf: + - $ref: '#/components/schemas/amount' + - $ref: '#/components/schemas/null_field' description: | - Invoice number of the expense. - example: 123456 - expense_check_mandatory_fields_in: - required: - - id - properties: - id: - $ref: '#/components/schemas/id_string' - spent_at: - $ref: '#/components/schemas/spent_at' - claim_amount: - $ref: '#/components/schemas/claim_amount' - allOf: - - $ref: '#/components/schemas/spender_expense_check_mandatory_fields_in' - expense_check_mandatory_fields_out: + Amount that the policy calculation suggests for this expense. + example: 500 + expenses_query_object: + nullable: true + $ref: '#/components/schemas/expense_policy_expenses_query_object' + expense_check_policies_final_desired_state: type: object - additionalProperties: false required: - - missing_amount - - missing_currency - - missing_receipt - - missing_expense_field_ids + - flag + - amount + - unreportable + - is_receipt_mandatory + - add_approver_user_ids + - remove_employee_approver1 + - run_status + - run_summary properties: - missing_amount: + flag: type: boolean description: | - If this is set to true, then you need to send amount field with expense object. - example: false - missing_currency: + A true value here means, that as per policy calculation this expense should be flagged. + example: true + amount: + nullable: true + anyOf: + - $ref: '#/components/schemas/amount' + - $ref: '#/components/schemas/null_field' + description: | + Amount that the policy calculation suggests for this expense. + example: 500 + unreportable: type: boolean + nullable: false description: | - If this is set to true, then you need to send currency field with expense object. - example: false - missing_receipt: + A true value here means, that as per policy calculation this expense should be made unreportable. + example: true + is_receipt_mandatory: type: boolean description: | - If this is set to true, then you need to attach receipt to the expense. - example: false - missing_expense_field_ids: + A true value here means, that as per policy calculation this expense requires receipt. + example: true + add_approver_user_ids: + nullable: true type: array - nullable: false items: - type: integer - nullable: true - description: | - This id provided by Sage Exp Mgmt to identify an expense field. - example: 123 + type: string + description: | + List of approver ids that the policy calculation suggests adding to report that contains this expense. example: - - 123 - - 12423 + - usBdsdfscl + - usLSsdfwqt + remove_employee_approver1: + type: boolean description: | - List of IDs of expense fields which are mandatory but are missing. + A true value here means, that as per policy calculation, the employee's first approver should be removed from the report that contains this expense. + example: true + run_status: + nullable: false + type: string + enum: + - SUCCESS + - FAILURE + description: | + This represent the run status of the policy. + example: SUCCESS + run_summary: + type: array + items: + type: string + description: | + List of human-readable action summaries that the policy calculation suggests for this expense. + example: + - flag the expense + - cap the amount + expense_check_policies_bulk_out: + type: array + additionalProperties: false + items: + type: object + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: tx0agOdICdbV + individual_desired_states: + type: array + items: + $ref: '#/components/schemas/expense_check_policies_individual_desired_states' + final_desired_state: + $ref: '#/components/schemas/expense_check_policies_final_desired_state' + expense_action_data_embed: + type: object + description: Data related to expense action. + nullable: true expense_comments_out: type: object additionalProperties: false @@ -8292,6 +10049,8 @@ components: - org_id - updated_at - created_at + - creator_user_id + - creator_user properties: id: $ref: '#/components/schemas/id_string' @@ -8324,9 +10083,7 @@ components: - UNMATCHED example: COMMENTED_WITH_NOTIFICATION action_data: - type: object - description: Data related to expense action. - nullable: true + $ref: '#/components/schemas/expense_action_data_embed' expense_id: $ref: '#/components/schemas/id_string' creator_type: @@ -8357,7 +10114,6 @@ components: required: - expense_id - comment - - notify properties: expense_id: $ref: '#/components/schemas/id_string' @@ -8391,6 +10147,8 @@ components: expense_duplicate_sets_out: type: object additionalProperties: false + required: + - expense_ids properties: expense_ids: type: array @@ -8403,6 +10161,8 @@ components: description: | List of expense IDs that are part of the duplicate set expenses_stats_in: + required: + - query_params properties: query_params: nullable: false @@ -8489,6 +10249,16 @@ components: expense_filters_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - name + - is_shared + - query_string + - sub_feature properties: id: allOf: @@ -8537,6 +10307,9 @@ components: example: exfilumWHrlPf7K expenses_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -8647,6 +10420,17 @@ components: expenses_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - notify_emails + - config + - file_id + - state properties: created_at: $ref: '#/components/schemas/created_at' @@ -8709,7 +10493,7 @@ components: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' is_reimbursable: $ref: '#/components/schemas/is_reimbursable' @@ -8786,7 +10570,7 @@ components: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' category_id: allOf: @@ -8813,188 +10597,52 @@ components: admin_expense_split_object: type: array items: - required: - - admin_amount - allOf: - - $ref: '#/components/schemas/expense_split_object' - properties: - admin_amount: - type: number - nullable: false - description: | - The expense amount which is added or modified by admin or approver. - example: 1900 - admin_split_expense_in: - type: object - required: - - id - - admin_amount - allOf: - - $ref: '#/components/schemas/split_expense_in' - properties: - id: - allOf: - - $ref: '#/components/schemas/id_string' - description: | - This id is provided by Sage Exp Mgmt to identify an object - - When `id` is sent, default action is to update the expense - admin_amount: - type: number - nullable: false - description: | - The expense amount which is added or modified by admin or approver. - example: 1900 - splits: - description: | - This array contains the number of split expenses admin wants to create for the expense. - The `admin_amount` provided for the original expense should be equal to the sum of - `admin_amount` provided for each split. Each attribute in the splits array will take precedence - to the original expense object. If any attribute is not provided in the split object, then - null or default value will be taken for that attribute in the resultant split. - allOf: - - $ref: '#/components/schemas/admin_expense_split_object' - expense_check_policies_individual_desired_states: - type: object - properties: - add_approver_user_ids: - nullable: true - type: array - items: - type: string - description: | - List of approver ids that the policy calculation suggests adding to report that contains this expense. - example: - - usBdsdfscl - - usLSsdfwqt - approver_policy_order: - type: integer - nullable: true - description: | - This represents the order of the approver policy related to this individual desired state record. - If the policy does not add any approver, this field will be null. - example: 1 - approver_source: - type: string - enum: - - PRIMARY_APPROVER - - SECONDARY_APPROVER_1 - - SECONDARY_APPROVER_2 - - PROJECT_APPROVER_1 - - PROJECT_APPROVER_2 - - DEPARTMENT_HEAD_APPROVER - - EMAIL_APPROVER - - null - nullable: true - description: | - This represents the type of approver(source) that was added by the approver policy related to this individual - desired state record. If the policy does not add any approver, this field will be null. - example: PROJECT_APPROVER_1 - expense_policy_rule_id: - type: string - description: | - This represents the id of the expense policy rule. - example: tprabsdfSYqd - expense_policy_rule: - $ref: '#/components/schemas/expense_policy_rule_embed' - run_status: - nullable: false - type: string - enum: - - VIOLATED_ACTION_SUCCESS - - VIOLATED_ACTION_FAILURE - - UNVIOLATED - description: | - This represents the status of policy computation for the input expense object against the policy represented by `expense_policy_rule_id`. - If the state is `UNVIOLATED`, it means that the expense is not violating this policy. If the state is `VIOLATION_ACTION_SUCCESS`, - it means that the expense is violating this policy and action stated in the object will be applied to the expense when it is saved. - However, if the state is `VIOLATION_ACTION_FAILURE`, it means that this policy is violated for the expense but since some approver was - missing or not set up properly, it will fail to take action on the expense when it is saved. - example: SUCCESS - run_result: - type: array - items: - type: string - description: | - List of human-readable action summaries that the policy calculation suggests for this expense. Note that, in - case some approver was not setup properly for the given violation, this array will contain description of - missing approvers. For example, Department approver, Project head, etc. - example: - - flag the expense - - cap the amount - amount: - nullable: true - anyOf: - - $ref: '#/components/schemas/amount' - - $ref: '#/components/schemas/null_field' - description: | - Amount that the policy calculation suggests for this expense. - example: 500 - expenses_query_object_params: - nullable: true - $ref: '#/components/schemas/expense_policy_expenses_query_object' - expense_check_policies_final_desired_state: + required: + - admin_amount + allOf: + - $ref: '#/components/schemas/expense_split_object' + properties: + admin_amount: + type: number + nullable: false + description: | + The expense amount which is added or modified by admin or approver. + example: 1900 + admin_split_expense_in: type: object + required: + - id + - admin_amount + allOf: + - $ref: '#/components/schemas/split_expense_in' properties: - flag: - type: boolean - description: | - A true value here means, that as per policy calculation this expense should be flagged. - example: true - amount: - nullable: true - anyOf: - - $ref: '#/components/schemas/amount' - - $ref: '#/components/schemas/null_field' - description: | - Amount that the policy calculation suggests for this expense. - example: 500 - unreportable: - type: boolean - nullable: false - description: | - A true value here means, that as per policy calculation this expense should be made unreportable. - example: true - is_receipt_mandatory: - type: boolean - description: | - A true value here means, that as per policy calculation this expense requires receipt. - example: true - add_approver_user_ids: - nullable: true - type: array - items: - type: string - description: | - List of approver ids that the policy calculation suggests adding to report that contains this expense. - example: - - usBdsdfscl - - usLSsdfwqt - remove_employee_approver1: - type: boolean + id: + allOf: + - $ref: '#/components/schemas/id_string' description: | - A true value here means, that as per policy calculation, the employee's first approver should be removed from the report that contains this expense. - example: true - run_status: + This id is provided by Sage Exp Mgmt to identify an object + - When `id` is sent, default action is to update the expense + admin_amount: + type: number nullable: false - type: string - enum: - - SUCCESS - - FAILURE description: | - This represent the run status of the policy. - example: SUCCESS - run_summary: - type: array - items: - type: string + The expense amount which is added or modified by admin or approver. + example: 1900 + splits: description: | - List of human-readable action summaries that the policy calculation suggests for this expense. - example: - - flag the expense - - cap the amount + This array contains the number of split expenses admin wants to create for the expense. + The `admin_amount` provided for the original expense should be equal to the sum of + `admin_amount` provided for each split. Each attribute in the splits array will take precedence + to the original expense object. If any attribute is not provided in the split object, then + null or default value will be taken for that attribute in the resultant split. + allOf: + - $ref: '#/components/schemas/admin_expense_split_object' expense_check_policies_out: type: object additionalProperties: false + required: + - individual_desired_states + - final_desired_state properties: individual_desired_states: type: array @@ -9047,6 +10695,17 @@ components: file_out: type: object additionalProperties: false + required: + - id + - org_id + - user_id + - created_at + - updated_at + - name + - type + - content_type + - download_url + - upload_url properties: id: $ref: '#/components/schemas/id_string' @@ -9086,12 +10745,20 @@ components: Returns null if linked to an expense or advance request in approved or higher state. file_generate_urls_action_in: type: object + required: + - id properties: id: $ref: '#/components/schemas/id_string' file_generate_urls_action_out: type: object additionalProperties: false + required: + - id + - name + - content_type + - download_url + - upload_url properties: id: $ref: '#/components/schemas/id_string' @@ -9143,6 +10810,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - vehicle_type + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -9215,9 +10886,30 @@ components: description: | String denoting the full name of an employee. example: Jon Snow + delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: + - SUBMIT + - APPROVE delegatees: type: object additionalProperties: false + required: + - id + - type + - user_id + - email + - full_name + - start_at + - scopes properties: id: allOf: @@ -9257,9 +10949,55 @@ components: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true + scopes: + allOf: + - $ref: '#/components/schemas/delegation_access_scope' + nullable: true employee_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - business_unit + - code + - custom_fields + - department + - department_id + - is_enabled + - joined_at + - level + - level_id + - location + - org_id + - roles + - special_email + - title + - user_id + - user + - mileage_rate_ids + - mileage_rates + - cost_center_ids + - cost_centers + - per_diem_rate_ids + - per_diem_rates + - project_ids + - projects + - approver_user_ids + - approver_users + - has_accepted_invite + - branch_account + - branch_ifsc + - mobile + - locale + - mileage_settings + - ach_account + - delegatees + - category_ids + - categories + - flattened_custom_field + - is_mobile_verified properties: id: $ref: '#/components/schemas/id_string' @@ -9289,7 +11027,7 @@ components: department_id: $ref: '#/components/schemas/fk_string' department: - $ref: '#/components/schemas/department_out_embed' + $ref: '#/components/schemas/department_out_employee_embed' is_enabled: allOf: - $ref: '#/components/schemas/is_enabled' @@ -9494,6 +11232,17 @@ components: account_out: type: object additionalProperties: false + required: + - id + - created_at + - updated_at + - user_id + - type + - currency + - current_balance_amount + - tentative_balance_amount + - org_id + - category_id properties: id: allOf: @@ -9538,6 +11287,29 @@ components: spender_employee_settings_out: type: object additionalProperties: false + required: + - id + - employee_id + - org_id + - created_at + - updated_at + - category_ids + - cost_center_ids + - project_ids + - per_diem_rate_ids + - mileage_rate_ids + - insta_fyle_settings + - notification_settings + - mileage_settings + - expense_form_autofills + - data_extractor_settings + - in_app_chat_settings + - payment_mode_settings + - locale + - is_personal_cards_enabled + - default_project_id + - default_payment_mode + - default_vehicle_type properties: id: $ref: '#/components/schemas/id_string' @@ -9675,21 +11447,7 @@ components: example: true description: Whether to notify the delegatee about events mileage_settings: - type: object - nullable: true - additionalProperties: false - description: Settings for mileage tracking and rates - properties: - mileage_rate_labels: - type: object - nullable: true - example: null - description: Labels for different mileage rates - annual_mileage_of_user_before_joining_fyle: - type: object - nullable: true - example: {} - description: Annual mileage limit for user before joining Sage Exp Mgmt + $ref: '#/components/schemas/mileage_settings' expense_form_autofills: type: object nullable: true @@ -9773,20 +11531,24 @@ components: nullable: true additionalProperties: false description: Settings for user's locale and timezone + required: + - timezone + - abbreviation + - offset properties: timezone: type: string - nullable: true + nullable: false example: Asia/Kolkata description: User's timezone abbreviation: type: string - nullable: true + nullable: false example: IST description: Timezone abbreviation offset: type: string - nullable: true + nullable: false example: '05:30:00' description: Timezone offset from UTC is_personal_cards_enabled: @@ -9831,7 +11593,6 @@ components: required: - id - approver_email - - comment properties: id: $ref: '#/components/schemas/id_string' @@ -9885,7 +11646,7 @@ components: type: string description: Reason for sending the advance request back to the spender example: Please provide additional documentation - advance_request_in: + advance_request_in_base: type: object properties: id: @@ -9923,9 +11684,27 @@ components: $ref: '#/components/schemas/fk_integer' custom_fields: $ref: '#/components/schemas/advance_request_custom_fields' + advance_request_submit_in: + allOf: + - $ref: '#/components/schemas/advance_request_in_base' + - type: object + required: + - currency + - amount advance_request_custom_field_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - type + - options + - is_mandatory + - is_enabled + - placeholder properties: id: type: integer @@ -10002,6 +11781,15 @@ components: employee_hierarchy_out: type: object additionalProperties: false + required: + - user_id + - org_id + - name + - email + - title + - depth + - has_accepted_invite + - primary_approver_user_id properties: user_id: $ref: '#/components/schemas/user_id' @@ -10035,6 +11823,18 @@ components: employee_overview_out: type: object additionalProperties: false + required: + - user_id + - org_id + - user + - employee_id + - employee + - primary_approver_id + - primary_approver + - department_id + - department + - expense_total_amount + - expense_count properties: user: type: object @@ -10134,6 +11934,9 @@ components: employee_overview_stats_out: type: object additionalProperties: false + required: + - count + - total_amount properties: count: type: integer @@ -10146,6 +11949,9 @@ components: employee_overview_expense_stats_out: type: object additionalProperties: false + required: + - count + - total_amount properties: count: type: integer @@ -10214,6 +12020,10 @@ components: example: GET(merchant) expenses_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -10237,7 +12047,7 @@ components: type: object additionalProperties: true properties: - is_column_header_included: + is_header_visible: type: boolean description: | Whether to include column headers in the export file. Required for CSV and EXCEL export types. @@ -10273,6 +12083,17 @@ components: expenses_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -10288,16 +12109,6 @@ components: $ref: '#/components/schemas/created_at' updated_at: $ref: '#/components/schemas/updated_at' - created_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | @@ -10371,9 +12182,9 @@ components: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature expenses_export_configuration_in_only_id: type: object required: @@ -10441,6 +12252,10 @@ components: example: GET(employee, user, full_name) reports_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -10495,6 +12310,17 @@ components: reports_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -10510,16 +12336,6 @@ components: $ref: '#/components/schemas/created_at' updated_at: $ref: '#/components/schemas/updated_at' - created_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | @@ -10593,9 +12409,9 @@ components: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature reports_export_configuration_in_only_id: type: object required: @@ -10605,15 +12421,13 @@ components: id: $ref: '#/components/schemas/id_string' parameters: - id: + q: in: query - name: id - description: | - A resource ID + name: q + description: A search query to filter the results. schema: type: string - example: - - eq.ouwruogwnngg + example: Ritas created_at: in: query name: created_at @@ -10630,15 +12444,15 @@ components: schema: type: string example: gte.2020-06-01T00:00:00.000-08:00 - display_name: + order: in: query - name: display_name + name: order description: | - Supported operators are `eq`, `like`, `in`.
- display_name=in.(value1,value2) + use comma separated column names for sorting the results.
+ For sorting in descending order, use `column_name.desc` schema: type: string - example: like.Fast* + example: updated_at.desc,id offset: in: query name: offset @@ -10657,22 +12471,24 @@ components: example: 20 default: 50 maximum: 200 - order: + id: in: query - name: order + name: id description: | - use comma separated column names for sorting the results.
- For sorting in descending order, use `column_name.desc` + A resource ID schema: type: string - example: updated_at.desc,id - q: + example: + - eq.ouwruogwnngg + display_name: in: query - name: q - description: A search query to filter the results. + name: display_name + description: | + Supported operators are `eq`, `like`, `in`.
+ display_name=in.(value1,value2) schema: type: string - example: Ritas + example: like.Fast* expense_id: in: query name: expense_id diff --git a/reference/authorization.yaml b/reference/authorization.yaml index 620f476c9..b42cb58a3 100644 --- a/reference/authorization.yaml +++ b/reference/authorization.yaml @@ -126,7 +126,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions diff --git a/reference/common.yaml b/reference/common.yaml index e4e3588a2..3c1925f3c 100644 --- a/reference/common.yaml +++ b/reference/common.yaml @@ -16,10 +16,39 @@ tags: - name: Currencies description: | These APIs gives you list of currencies supported by Sage Exp Mgmt and their exchange rates. + - name: Miscellaneous + description: | + General common operations. - name: Places description: | These APIs gives the places suggestions and geographic data of a place. paths: + /common/dummy: + get: + tags: + - Miscellaneous + security: [] + x-internal: true + summary: Get dummy data + description: | + Returns a dummy response. + operationId: common_dummy_get + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + additionalProperties: false + '404': + description: Resource not found /common/places/autocomplete: get: tags: @@ -78,6 +107,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -121,6 +154,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -155,6 +192,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: object @@ -377,6 +416,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/exchange_rate_out' @@ -407,6 +448,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/logo_file_generate_download_url_action_out' @@ -434,7 +477,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions @@ -481,6 +524,9 @@ components: example: 10 place_out_minimal: type: object + required: + - id + - formatted_address properties: id: type: string @@ -493,6 +539,14 @@ components: place_out: type: object additionalProperties: false + required: + - id + - city + - state + - country + - formatted_address + - latitude + - longitude properties: id: type: string @@ -519,6 +573,8 @@ components: example: 77.594566 exchange_rate_out: type: object + required: + - exchange_rate additionalProperties: false properties: exchange_rate: @@ -532,6 +588,11 @@ components: example: sdfd2391 logo_file_generate_download_url_action_out: type: object + required: + - id + - name + - content_type + - download_url additionalProperties: false properties: id: diff --git a/reference/hod.yaml b/reference/hod.yaml index 8a7c782e1..d2371946e 100644 --- a/reference/hod.yaml +++ b/reference/hod.yaml @@ -33,6 +33,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -60,7 +64,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions @@ -151,6 +155,12 @@ components: budget_out_embed: type: object additionalProperties: false + required: + - id + - name + - type + - amount_limit + - is_enabled properties: id: $ref: '#/components/schemas/id_string' @@ -174,6 +184,14 @@ components: - spent - amount_limit - budget + - created_at + - updated_at + - id + - org_id + - start_date + - end_date + - budget_department_ids + - budget_project_ids additionalProperties: false properties: id: diff --git a/reference/hop.yaml b/reference/hop.yaml index b32e7f01e..0403992ce 100644 --- a/reference/hop.yaml +++ b/reference/hop.yaml @@ -33,6 +33,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -60,7 +64,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions @@ -151,6 +155,12 @@ components: budget_out_embed: type: object additionalProperties: false + required: + - id + - name + - type + - amount_limit + - is_enabled properties: id: $ref: '#/components/schemas/id_string' @@ -174,6 +184,14 @@ components: - spent - amount_limit - budget + - created_at + - updated_at + - id + - org_id + - start_date + - end_date + - budget_department_ids + - budget_project_ids additionalProperties: false properties: id: diff --git a/reference/manager.yaml b/reference/manager.yaml index fa3a4ab70..5a8677c34 100644 --- a/reference/manager.yaml +++ b/reference/manager.yaml @@ -31,6 +31,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -110,6 +114,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -177,6 +183,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -235,6 +245,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -289,6 +301,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: data: type: array @@ -367,6 +383,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/employee_overview_stats_out' @@ -430,6 +448,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -477,6 +499,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -548,6 +574,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/employee_overview_expense_stats_out' @@ -586,7 +614,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions @@ -671,6 +699,10 @@ components: description: | This id is provided by Sage Exp Mgmt to identify an object. example: sdfd2391 + expense_action_data_embed: + type: object + description: Data related to expense action. + nullable: true user_id_nullable: type: string description: | @@ -689,6 +721,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - email + - full_name properties: id: allOf: @@ -733,6 +769,8 @@ components: - org_id - updated_at - created_at + - creator_user_id + - creator_user properties: id: $ref: '#/components/schemas/id_string' @@ -765,9 +803,7 @@ components: - UNMATCHED example: COMMENTED_WITH_NOTIFICATION action_data: - type: object - description: Data related to expense action. - nullable: true + $ref: '#/components/schemas/expense_action_data_embed' expense_id: $ref: '#/components/schemas/id_string' creator_type: @@ -790,12 +826,20 @@ components: $ref: '#/components/schemas/org_id' file_generate_urls_action_in: type: object + required: + - id properties: id: $ref: '#/components/schemas/id_string' file_generate_urls_action_out: type: object additionalProperties: false + required: + - id + - name + - content_type + - download_url + - upload_url properties: id: $ref: '#/components/schemas/id_string' @@ -843,6 +887,11 @@ components: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: true + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false @@ -892,6 +941,11 @@ components: example: eq.ouNSnadfaLA expense_policy_expenses_query_object: type: object + required: + - limit_start_date + - limit_end_date + - params + nullable: true description: | An expense may be violating an expense policy rule due to a group of other expenses. These query params can be used to fetch those expenses because of which this expense is causing a violation.
@@ -902,6 +956,7 @@ components: description: | Spend start date query param to find the list of violating expenses. example: '2021-12-01' + nullable: true limit_end_date: type: string description: | @@ -911,6 +966,17 @@ components: $ref: '#/components/schemas/expense_policy_expenses_query_object_params' expense_policy_individual_desired_states: type: object + required: + - add_approver_user_ids + - approver_policy_order + - approver_source + - expense_id + - expense_policy_rule_id + - expense_policy_rule + - run_status + - run_result + - amount + - expenses_query_object properties: add_approver_user_ids: nullable: true @@ -981,7 +1047,7 @@ components: description: | This represents the id of the expense policy rule. example: tprabsdfSYqd - rule: + expense_policy_rule: $ref: '#/components/schemas/expense_policy_rule_embed' amount: nullable: true @@ -991,11 +1057,21 @@ components: description: | Amount that the policy calculation suggests for this expense. example: 500 - expenses_query_object_params: + expenses_query_object: nullable: true $ref: '#/components/schemas/expense_policy_expenses_query_object' expense_policy_final_desired_state: type: object + required: + - expense_id + - flag + - amount + - unreportable + - is_receipt_mandatory + - add_approver_user_ids + - remove_employee_approver1 + - run_status + - run_summary properties: expense_id: type: string @@ -1062,6 +1138,10 @@ components: expense_policy_states_out: type: object additionalProperties: false + required: + - expense_id + - individual_desired_states + - final_desired_state properties: expense_id: type: string @@ -1088,6 +1168,15 @@ components: employee_hierarchy_out: type: object additionalProperties: false + required: + - user_id + - org_id + - name + - email + - title + - depth + - has_accepted_invite + - primary_approver_user_id properties: user_id: $ref: '#/components/schemas/user_id' @@ -1132,6 +1221,18 @@ components: employee_overview_out: type: object additionalProperties: false + required: + - user_id + - org_id + - user + - employee_id + - employee + - primary_approver_id + - primary_approver + - department_id + - department + - expense_total_amount + - expense_count properties: user: type: object @@ -1231,6 +1332,9 @@ components: employee_overview_stats_out: type: object additionalProperties: false + required: + - count + - total_amount properties: count: type: integer @@ -1250,6 +1354,10 @@ components: user_out_embed: type: object additionalProperties: false + required: + - id + - email + - full_name properties: id: allOf: @@ -1276,10 +1384,15 @@ components: description: | This represents the name of the resource. This should be unique in an organization example: foo123 - department_out_embed: + department_out_employee_embed: type: object additionalProperties: false nullable: true + required: + - id + - code + - name + - sub_department properties: id: $ref: '#/components/schemas/id_string' @@ -1293,11 +1406,6 @@ components: type: string nullable: true example: Outbound Sales - display_name: - type: string - example: Sales / Outbound Sales - description: | - This is a combination of name and sub_department separated by a / and spaces. In case if no sub_department is present it is same as name of the department. timestamptz_utc: type: string format: date-time @@ -1457,6 +1565,12 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - sub_project + - code + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -1483,6 +1597,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -1498,6 +1616,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -1511,6 +1633,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - vehicle_type + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -1590,9 +1716,30 @@ components: description: | String denoting the full name of an employee. example: Jon Snow + delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: + - SUBMIT + - APPROVE delegatees: type: object additionalProperties: false + required: + - id + - type + - user_id + - email + - full_name + - start_at + - scopes properties: id: allOf: @@ -1632,10 +1779,21 @@ components: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true + scopes: + allOf: + - $ref: '#/components/schemas/delegation_access_scope' + nullable: true category_out_embed: type: object nullable: true additionalProperties: false + required: + - id + - system_category + - name + - sub_category + - code + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -1666,6 +1824,48 @@ components: employee_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - business_unit + - code + - custom_fields + - department + - department_id + - is_enabled + - joined_at + - level + - level_id + - location + - org_id + - roles + - special_email + - title + - user_id + - user + - mileage_rate_ids + - mileage_rates + - cost_center_ids + - cost_centers + - per_diem_rate_ids + - per_diem_rates + - project_ids + - projects + - approver_user_ids + - approver_users + - has_accepted_invite + - branch_account + - branch_ifsc + - mobile + - locale + - mileage_settings + - ach_account + - delegatees + - category_ids + - categories + - flattened_custom_field + - is_mobile_verified properties: id: $ref: '#/components/schemas/id_string' @@ -1695,7 +1895,7 @@ components: department_id: $ref: '#/components/schemas/fk_string' department: - $ref: '#/components/schemas/department_out_embed' + $ref: '#/components/schemas/department_out_employee_embed' is_enabled: allOf: - $ref: '#/components/schemas/is_enabled' @@ -1923,6 +2123,9 @@ components: example: 1234 account_out_embed: type: object + required: + - id + - type properties: id: allOf: @@ -1942,6 +2145,11 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - vehicle_type + - code + - rate properties: id: $ref: '#/components/schemas/id_integer' @@ -1955,6 +2163,58 @@ components: example: 10 nullable: true description: Amount (in Home currency) per unit. + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Vehicle ownership for advanced mileage rates. `null` for basic mileage rates. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Vehicle category for advanced mileage rates. `null` for basic mileage rates. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Fuel type for advanced car mileage rates. `null` otherwise. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Engine capacity band for petrol, diesel, and LPG advanced car rates. An empty object for basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Charging location for advanced electric car mileage rates. `null` otherwise. expense_custom_field: type: object description: | @@ -2017,13 +2277,34 @@ components: report_approval_out_embed: type: object additionalProperties: false + required: + - approver_user_id + - approver_user + - state properties: approver_user_id: allOf: - $ref: '#/components/schemas/id_string' + nullable: true + description: | + The user ID of the approver. This is null when approver_type is SYSTEM (auto-approval). example: usge49ielgel + approver_type: + type: string + enum: + - USER + - SYSTEM + description: | + Type of approver. + - USER: A human approver identified by approver_user_id + - SYSTEM: Automatic approval by the system (auto-approval feature). When approver_type is SYSTEM, approver_user_id is null. + example: USER approver_user: - $ref: '#/components/schemas/user_out_embed' + allOf: + - $ref: '#/components/schemas/user_out_embed' + nullable: true + description: | + The user object of the approver. This is null when approver_type is SYSTEM. state: type: string enum: @@ -2052,6 +2333,9 @@ components: - last_paid_at - reimbursement_id - reimbursement_seq_num + - amount + - last_verified_at + - approvals properties: id: anyOf: @@ -2140,6 +2424,11 @@ components: List of report_approval objects file_out_embed: type: object + required: + - id + - name + - type + - content_type properties: id: allOf: @@ -2175,6 +2464,9 @@ components: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string @@ -2182,6 +2474,9 @@ components: expense_verification_out_embed: type: object additionalProperties: false + required: + - verifier_user_id + - verifier_user properties: verifier_user_id: allOf: @@ -2201,10 +2496,51 @@ components: maxLength: 255 nullable: true example: dept9in4oIHpdR + department_out_embed: + type: object + additionalProperties: false + nullable: true + required: + - id + - code + - name + - sub_department + - display_name + properties: + id: + $ref: '#/components/schemas/id_string' + code: + $ref: '#/components/schemas/code' + name: + allOf: + - $ref: '#/components/schemas/name' + example: Sales + sub_department: + type: string + nullable: true + example: Outbound Sales + display_name: + type: string + example: Sales / Outbound Sales + description: | + This is a combination of name and sub_department separated by a / and spaces. In case if no sub_department is present it is same as name of the department. employee_out_embed_for_expense: type: object additionalProperties: false nullable: true + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department + - location + - title + - business_unit + - custom_fields + - flattened_custom_field properties: id: $ref: '#/components/schemas/id_string' @@ -2319,6 +2655,21 @@ components: - id - corporate_card_id - corporate_card_number + - corporate_card_nickname + - masked_corporate_card_number + - bank_name + - corporate_card_user_full_name + - amount + - currency + - spent_at + - posted_at + - status + - description + - foreign_currency + - foreign_amount + - merchant + - category + - matched_by properties: id: allOf: @@ -2363,6 +2714,11 @@ components: description: | String denoting the card holder's full name example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false amount: $ref: '#/components/schemas/amount' currency: @@ -2425,6 +2781,128 @@ components: description: | String denoting the email of the user who matched the card transaction to an expense. example: john.ooe@sage.com + matched_corporate_card_transaction_out_embed_new: + anyOf: + - type: object + additionalProperties: false + properties: {} + description: Empty object when no corporate card transaction is matched + - type: object + required: + - id + - corporate_card_id + - corporate_card_number + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: btxnwownwrng + corporate_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + corporate_card_number: + $ref: '#/components/schemas/card_number' + corporate_card_nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: Business Card + corporate_card_cardholder_name: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the card holder's name + example: John Cena + capitalone_virtual_card_last_four: + type: string + nullable: true + description: | + Last four digits of capitalone virtual card. + example: '4521' + masked_corporate_card_number: + $ref: '#/components/schemas/card_number' + bank_name: + nullable: true + $ref: '#/components/schemas/bank_name' + corporate_card_user_full_name: + nullable: true + allOf: + - $ref: '#/components/schemas/name_nullable' + maxLength: 255 + description: | + String denoting the card holder's full name + example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false + amount: + $ref: '#/components/schemas/amount' + currency: + $ref: '#/components/schemas/currency' + spent_at: + allOf: + - $ref: '#/components/schemas/spent_at' + description: | + Signifies spent date of a card transaction. + This date cannot be in future. + posted_at: + nullable: true + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies post date of a card transaction. + This date cannot be in future. + status: + type: string + nullable: true + enum: + - PENDING + - POSTED + - null + example: PENDING + description: | + Signifies status of a card transaction. + description: + type: string + nullable: true + description: | + Holds the description of the card transaction + example: Team lunch + foreign_currency: + nullable: true + allOf: + - $ref: '#/components/schemas/foreign_currency' + foreign_amount: + nullable: true + allOf: + - $ref: '#/components/schemas/foreign_amount' + merchant: + nullable: true + allOf: + - $ref: '#/components/schemas/merchant' + description: | + String denoting the name of the vendor to which the card transaction was made. + Note: This is not same as the merchant added in Sage Exp Mgmt but just a string + category: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the category of the card transaction + Note: This is not same as the category added in Sage Exp Mgmt but just a string + example: Travel + matched_by: + type: string + nullable: true + description: | + String denoting the email of the user who matched the card transaction to an expense. + example: john.ooe@sage.com missing_mandatory_fields: type: object nullable: false @@ -2676,6 +3154,12 @@ components: example: 77.594566 commute_details: type: object + required: + - id + - distance + - distance_unit + - home_location + - work_location nullable: true description: | Commute details of the employee. This is used to deduct daily commute from the employee's mileage expenses. @@ -2744,12 +3228,18 @@ components: - source_account - tax_amount - tax_group_id + - calculated_tax_amount - is_billable - is_reimbursable - distance - distance_unit - mileage_calculated_distance - mileage_calculated_amount + - selected_vehicle_ownership + - selected_vehicle_category + - passenger_count + - passenger_mileage_rate + - passenger_amount - mileage_rate_id - mileage_rate - mileage_is_round_trip @@ -2768,6 +3258,7 @@ components: - seq_num - report_id - added_to_report_at + - added_to_report_by - report - is_verified - last_verified_at @@ -2780,6 +3271,8 @@ components: - is_corporate_card_transaction_auto_matched - matched_corporate_card_transaction_ids - matched_corporate_card_transactions + - matched_corporate_card_transaction_id + - matched_corporate_card_transaction - last_settled_at - missing_mandatory_fields - activity_details @@ -2793,6 +3286,26 @@ components: - invoice_number - is_duplicate_present - expense_policy_comments + - custom_fields_flattened + - approvals + - verifications + - employee_id + - split_group_amount + - expense_rule_id + - expense_rule_data + - is_split + - tax_group + - approver_comments + - verifier_comments + - policy_checks + - accounting_export_summary + - report_last_paid_at + - report_last_approved_at + - commute_deduction + - commute_details_id + - commute_details + - is_reconciled + - report_auto_approval_state properties: id: allOf: @@ -2915,6 +3428,12 @@ components: allOf: - $ref: '#/components/schemas/fk_string' nullable: true + calculated_tax_amount: + type: number + nullable: true + readOnly: true + description: | + System-derived tax amount for the expense amount and the selected tax group's rate. is_billable: type: boolean nullable: true @@ -2945,6 +3464,36 @@ components: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + selected_vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Selected vehicle ownership for an advanced mileage expense. `null` for a basic mileage expense. + selected_vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Selected vehicle category for an advanced mileage expense. `null` for a basic mileage expense. + passenger_count: + type: integer + nullable: true + description: Number of passengers carried on the mileage journey. + passenger_mileage_rate: + type: number + nullable: true + readOnly: true + description: Passenger mileage rate snapshot applied to this expense. `null` when passenger mileage does not apply. + passenger_amount: + type: number + nullable: true + description: Passenger mileage reimbursement amount for this expense. mileage_rate_id: allOf: - $ref: '#/components/schemas/fk_integer' @@ -3048,6 +3597,16 @@ components: description: | signifies when this expense was added to a report. If this expense is not added to a report, then this could be null. + added_to_report_by: + type: string + nullable: true + enum: + - USER + - SYSTEM + - null + description: | + Indicates whether the expense was added to the report it belongs to by a user or the system. If the expense is not a part of any report, this field will be null. + example: USER report: $ref: '#/components/schemas/report_out_embed' is_verified: @@ -3120,6 +3679,8 @@ components: $ref: '#/components/schemas/id_string' description: | Holds the corporate card transaction ids which are matched to this expense + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction_id` instead, as this array always contains a single value. example: - btxnwownwrng matched_corporate_card_transactions: @@ -3129,6 +3690,20 @@ components: description: | Holds the corporate card transactions which are matched to this expense. NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_ids` is already up-to-date. + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction` instead, as this array always contains a single value. + matched_corporate_card_transaction_id: + type: string + nullable: true + description: | + Holds the corporate card transaction id which is matched to this expense + example: btxnwownwrng + matched_corporate_card_transaction: + allOf: + - $ref: '#/components/schemas/matched_corporate_card_transaction_out_embed_new' + description: | + Holds the corporate card transaction which is matched to this expense. + NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_id` is already up-to-date. last_settled_at: allOf: - $ref: '#/components/schemas/timestamptz_utc' @@ -3297,7 +3872,18 @@ components: description: | Whether expenses is reconciled or not. example: true + report_auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the expense's report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null expenses_stats_in: + required: + - query_params properties: query_params: nullable: false @@ -3308,6 +3894,9 @@ components: employee_overview_expense_stats_out: type: object additionalProperties: false + required: + - count + - total_amount properties: count: type: integer diff --git a/reference/owner.yaml b/reference/owner.yaml index 0dbb232d8..cb2e521c8 100644 --- a/reference/owner.yaml +++ b/reference/owner.yaml @@ -249,7 +249,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions diff --git a/reference/spender.yaml b/reference/spender.yaml index d74ea1223..acfb3fc6d 100644 --- a/reference/spender.yaml +++ b/reference/spender.yaml @@ -113,6 +113,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -121,7 +125,7 @@ paths: data: type: array items: - $ref: '#/components/schemas/budget_out' + $ref: '#/components/schemas/spender_budget_out' '400': description: Bad request content: @@ -155,6 +159,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -191,6 +199,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -233,6 +245,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -269,6 +285,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -343,6 +363,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -379,6 +403,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -413,6 +441,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/my_profile_out' @@ -441,6 +471,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/recently_used_fields_out' @@ -472,6 +504,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -509,6 +545,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -547,6 +587,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: description: | @@ -641,6 +685,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/spender_expenses_bulk_in' @@ -651,6 +697,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -762,6 +810,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_out' @@ -811,6 +861,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_out' @@ -862,6 +914,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -927,6 +981,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -980,6 +1036,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_permissions_out' @@ -1043,6 +1101,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_permissions_bulk_out' @@ -1111,6 +1171,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1154,6 +1218,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1189,6 +1257,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/subscriptions_in' @@ -1200,6 +1270,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/spender_subscriptions_out' @@ -1249,6 +1321,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1304,6 +1380,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/schedule_out' @@ -1345,6 +1423,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1429,6 +1511,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -1537,6 +1623,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_out' @@ -1587,6 +1675,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_out' @@ -1635,6 +1725,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_out' @@ -1683,6 +1775,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_out' @@ -1732,6 +1826,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/reports_stats_out' @@ -1786,6 +1882,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_purpose_out' @@ -1833,6 +1931,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/report_filters_out' @@ -1869,6 +1969,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: data: type: array @@ -1890,7 +1994,7 @@ paths: application/json: schema: $ref: '#/components/schemas/401' - /spender/reports/filters/delte: + /spender/reports/filters/delete: post: tags: - Reports @@ -1916,6 +2020,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/report_filters_out' @@ -1970,6 +2076,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_comments_out' @@ -2019,6 +2127,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/report_permissions_out' @@ -2060,6 +2170,11 @@ paths: content: application/json: schema: + type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2106,6 +2221,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/reports_exports_out' @@ -2142,6 +2259,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2187,7 +2308,7 @@ paths: - data properties: data: - $ref: '#/components/schemas/advance_request_in' + $ref: '#/components/schemas/spender_advance_request_in' responses: '200': description: OK @@ -2196,6 +2317,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -2251,6 +2374,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_requests_stats_out' @@ -2293,6 +2418,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2348,6 +2477,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advances_stats_out' @@ -2390,6 +2521,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2432,6 +2567,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2468,6 +2607,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2489,6 +2632,46 @@ paths: application/json: schema: $ref: '#/components/schemas/401' + /spender/corporate_cards/rtf_monthly_enrollment_usage: + get: + tags: + - Corporate Cards + summary: Get RTF monthly enrollment usage + description: | + This API returns the spender's current-month RTF corporate card enrollment usage, + including the number of cards enrolled, the configured monthly limit, and whether the limit has been reached. + operationId: corporate_cards_rtf_monthly_enrollment_usage + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/corporate_card_rtf_monthly_enrollment_usage_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' /spender/corporate_card_transactions: get: tags: @@ -2504,6 +2687,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2552,6 +2739,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -2606,6 +2795,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_mark_personal_out' @@ -2659,6 +2850,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_unmark_personal_out' @@ -2712,6 +2905,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_ignore_out' @@ -2765,6 +2960,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_undo_ignore_out' @@ -2818,6 +3015,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_match_out' @@ -2871,6 +3070,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/corporate_card_transaction_unmatch_out' @@ -2914,6 +3115,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -2962,6 +3167,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/spender_employee_out' @@ -3005,9 +3212,14 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: - $ref: '#/components/schemas/spender_employee_current_out' + anyOf: + - $ref: '#/components/schemas/spender_employee_current_out' + - type: object + additionalProperties: false '400': description: Bad request content: @@ -3205,6 +3417,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3586,6 +3802,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3634,6 +3854,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/virtual_cards_get_current_balance_out' @@ -3688,6 +3910,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/virtual_cards_show_card_details_out' @@ -3731,6 +3955,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -3780,6 +4008,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/file_out' @@ -3837,6 +4067,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -3908,6 +4140,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/file_generate_urls_action_out' @@ -3964,6 +4198,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -4133,6 +4369,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/file_out_download_url' @@ -4220,6 +4458,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -4266,6 +4508,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -4331,6 +4577,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_check_policies_out' @@ -4382,6 +4630,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expense_check_policies_bulk_out' @@ -4481,6 +4731,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/recurring_expense_out' @@ -4525,6 +4777,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -4580,6 +4836,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/recurring_expense_out' @@ -4753,6 +5011,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -4796,6 +5058,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_comments_bulk_in' @@ -4806,7 +5070,9 @@ paths: application/json: schema: type: object - properties: + required: + - data + properties: data: type: array items: @@ -4912,6 +5178,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -4957,6 +5225,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/expenses_stats_out' @@ -5010,6 +5280,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_filters_out' @@ -5046,6 +5318,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -5093,6 +5369,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_filters_out' @@ -5146,6 +5424,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expenses_exports_out' @@ -5181,6 +5461,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/spender_split_expense_in' @@ -5191,6 +5473,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -5237,6 +5521,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/spender_split_expense_in' @@ -5247,6 +5533,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -5292,6 +5580,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/spender_split_expense_in' @@ -5302,6 +5592,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array @@ -5345,6 +5637,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expenses_merge_in' @@ -5355,6 +5649,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expense_out' @@ -5397,6 +5693,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -5495,6 +5795,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -5527,6 +5829,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -5772,6 +6078,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -5946,11 +6256,13 @@ paths: application/json: schema: type: object + required: + - data properties: data: type: array items: - $ref: '#/components/schemas/expense_out' + $ref: '#/components/schemas/expense_out_with_department_name' '400': description: Bad request content: @@ -5990,6 +6302,8 @@ paths: application/json: schema: type: object + required: + - data additionalProperties: false properties: data: @@ -6034,6 +6348,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -6071,6 +6389,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -6121,6 +6443,9 @@ paths: type: array items: type: object + required: + - comment_type + - comment_text properties: comment_type: type: string @@ -6150,6 +6475,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: object @@ -6215,7 +6542,7 @@ paths: - data properties: data: - $ref: '#/components/schemas/advance_request_in' + $ref: '#/components/schemas/advance_request_submit_in' responses: '200': description: OK @@ -6224,6 +6551,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -6289,6 +6618,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_permissions_out' @@ -6347,6 +6678,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/advance_request_out' @@ -6409,6 +6742,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: array @@ -6452,6 +6787,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_comments_in' @@ -6462,6 +6799,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_comments_out' @@ -6557,6 +6896,10 @@ paths: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -6605,6 +6948,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '#/components/schemas/secondary_email_out' @@ -6664,6 +7009,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: object @@ -6727,6 +7074,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: type: object @@ -6767,6 +7116,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/advance_request_custom_fields_out' @@ -6809,6 +7160,8 @@ paths: schema: type: object additionalProperties: false + required: + - data properties: data: allOf: @@ -6896,6 +7249,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -7033,6 +7390,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/expenses_export_configuration_out' @@ -7164,6 +7523,10 @@ paths: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '#/components/schemas/count' @@ -7226,6 +7589,8 @@ paths: application/json: schema: type: object + required: + - data properties: data: $ref: '#/components/schemas/reports_export_configuration_out' @@ -7338,115 +7703,310 @@ paths: error: type: string example: InvalidUsage -components: - securitySchemes: - oauth2: - type: oauth2 - flows: - authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize - tokenUrl: https://accounts.fylehq.com/oauth/token - scopes: - '*': Grant all actions - schemas: - '400': - type: object - properties: - message: - type: string - nullable: true - description: | - Message describing why the request is invalid - '401': - type: object - properties: - message: - enum: - - invalid token - type: string - description: | - This error means that the input access token is either not issued by Sage Exp Mgmt or has expired. - You need to generate a new access token. - '403': - type: object - properties: - message: - enum: - - Forbidden - type: string - description: | - This error means current user does not have enough permissions to perform this operation. - '404': - type: object - properties: - message: - enum: - - Resource not found - type: string - description: | - This error means the requested resource was not found or the requester doesn't have sufficient access. - '409': - type: object - properties: - message: - type: string - nullable: true - description: | - Message describing why the request resulted in a conflict - '500': - type: object - properties: - message: - type: string - description: | - API server hit an internal error and could not process request. This is likely a bug. - count: - type: integer - description: | - The total number of objects that can be requested. - example: 10000 - offset: - description: | - offset is used to skip that many number of objects before counting.
- For example, if there are 2000 objects,
- The first request will have offset as 0 and limit as 200 to return first 200 objects.
- The second request will have offset as 200 and limit as 200 to return next 200 objects.
- type: integer - example: 10 - id_string: - type: string - maxLength: 15 - description: | - This id is provided by Sage Exp Mgmt to identify an object. - example: sdfd2391 - org_id: - type: string - description: | - The unique id of the Organization to which the object is associated. - readOnly: true - example: orwruogwnngg - created_at: - type: string - format: date-time - description: | - Signifies when this object was created in [ISO8601 format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14). - example: '2020-06-01T13:14:54.804+00:00' - updated_at: - type: string - format: date-time - description: | - Signifies when this object was updated in [ISO8601 format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14). - example: '2020-06-11T13:14:55.201598+00:00' - is_enabled: - type: boolean + /spender/mobile_app/versions: + get: + tags: + - Mobile App Versions + summary: List mobile app versions + operationId: mobile_app_versions_list description: | - This indicates if the resource is enabled for use within the organisation. - example: true - name: - type: string - maxLength: 255 + This API supports filtering and pagination via query parameters. Returns mobile app version entries for the current user. + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + description: | + The total number of objects that can be requested. + type: integer + example: 10000 + offset: + description: | + offset is used to skip that many number of objects before counting.
+ For example, if there are 2000 objects,
+ The first request will have offset as 0 and limit as 1000 to return first 1000 objects.
+ The second request will have offset as 1000 and limit as 1000 to return next 1000 objects.
+ type: integer + example: 10 + data: + type: array + items: + $ref: '#/components/schemas/mobile_app_version_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + post: + tags: + - Mobile App Versions + summary: Create a mobile app version entry + operationId: mobile_app_versions_post description: | - This represents the name of the resource. This should be unique in an organization + Creates a new mobile app version entry for the current user. Throws an error if an entry with the same (user_id, version, os.name, os.version) already exists. + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/mobile_app_version_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/mobile_app_version_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + /spender/mobile_app/rating_prompt_state: + get: + tags: + - Mobile app + summary: Get mobile app rating prompt state for the current user + operationId: mobile_app_rating_prompt_state_get + description: | + Returns persisted timestamps for in-app rating pre-prompt cooldowns. + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/rating_prompt_state_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' + post: + tags: + - Mobile app + summary: Update mobile app rating prompt state for the current user + operationId: mobile_app_rating_prompt_state_post + description: | + Records either a pre-prompt dismiss (`is_pre_prompt_dismissed: true`, native prompt not shown) or that the native + rating prompt was shown (`false`), using server UTC time. `created_at` is set only on first insert. + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/rating_prompt_state_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '#/components/schemas/rating_prompt_state_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '#/components/schemas/401' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/403' +components: + securitySchemes: + oauth2: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize + tokenUrl: https://accounts.fylehq.com/oauth/token + scopes: + '*': Grant all actions + schemas: + '400': + type: object + properties: + message: + type: string + nullable: true + description: | + Message describing why the request is invalid + '401': + type: object + properties: + message: + enum: + - invalid token + type: string + description: | + This error means that the input access token is either not issued by Sage Exp Mgmt or has expired. + You need to generate a new access token. + '403': + type: object + properties: + message: + enum: + - Forbidden + type: string + description: | + This error means current user does not have enough permissions to perform this operation. + '404': + type: object + properties: + message: + enum: + - Resource not found + type: string + description: | + This error means the requested resource was not found or the requester doesn't have sufficient access. + '409': + type: object + properties: + message: + type: string + nullable: true + description: | + Message describing why the request resulted in a conflict + '500': + type: object + properties: + message: + type: string + description: | + API server hit an internal error and could not process request. This is likely a bug. + count: + type: integer + description: | + The total number of objects that can be requested. + example: 10000 + offset: + description: | + offset is used to skip that many number of objects before counting.
+ For example, if there are 2000 objects,
+ The first request will have offset as 0 and limit as 200 to return first 200 objects.
+ The second request will have offset as 200 and limit as 200 to return next 200 objects.
+ type: integer + example: 10 + id_string: + type: string + maxLength: 15 + description: | + This id is provided by Sage Exp Mgmt to identify an object. + example: sdfd2391 + org_id: + type: string + description: | + The unique id of the Organization to which the object is associated. + readOnly: true + example: orwruogwnngg + created_at: + type: string + format: date-time + description: | + Signifies when this object was created in [ISO8601 format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14). + example: '2020-06-01T13:14:54.804+00:00' + updated_at: + type: string + format: date-time + description: | + Signifies when this object was updated in [ISO8601 format](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14). + example: '2020-06-11T13:14:55.201598+00:00' + is_enabled: + type: boolean + description: | + This indicates if the resource is enabled for use within the organisation. + example: true + name: + type: string + maxLength: 255 + description: | + This represents the name of the resource. This should be unique in an organization example: foo123 budget_type: nullable: false @@ -7466,30 +8026,32 @@ components: description: | amount of money example: 47.99 - id_integer: - type: integer - description: | - This id is provided by Sage Exp Mgmt to identify an object. - example: 1234 - email: - type: string - maxLength: 127 - example: john.doe@example.com - description: | - An immutable field that represents the email address of the employee. - Must be compliant with RFC 822. - budget_visibility: + budget_status: type: string enum: - - ONLY_ADMINS - - SPECIFIC_EMPLOYEES - - ALL_CONTRIBUTING_EMPLOYEES + - ON_TRACK + - NEAR_LIMIT + - EXCEEDED + - DISABLED description: | - Visibility of the budget - example: ONLY_ADMINS - budget_out: + Status of budget usage + example: ON_TRACK + spender_budget_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - is_enabled + - type + - amount_limit + - amount_spent + - amount_remaining + - utilisation_percentage + - status properties: id: $ref: '#/components/schemas/id_string' @@ -7509,83 +8071,6 @@ components: $ref: '#/components/schemas/budget_type' amount_limit: $ref: '#/components/schemas/amount' - alert_threshold: - nullable: true - type: number - example: 5000 - department_ids: - type: array - items: - $ref: '#/components/schemas/id_string' - example: - - 2222 - - 1221 - description: | - List of department ids - project_ids: - type: array - items: - $ref: '#/components/schemas/id_integer' - example: - - 2222 - - 1221 - description: | - List of project ids - cost_center_ids: - type: array - items: - $ref: '#/components/schemas/id_integer' - example: - - 2222 - - 1221 - description: | - List of cost center ids - category_ids: - type: array - items: - $ref: '#/components/schemas/id_integer' - example: - - 2222 - - 1221 - description: | - List of category ids - observer_ids: - type: array - items: - $ref: '#/components/schemas/id_string' - example: - - usge49ielgel - fiscal_year_start_month: - type: number - example: 10 - description: Month number of start of fiscal year - minimum: 1 - maximum: 12 - budget_start_date: - type: string - nullable: true - format: date-time - example: '2022-04-01T00:00:00+00:00' - description: Start date of the current budget interval - budget_end_date: - type: string - nullable: true - format: date-time - example: '2022-04-30T00:00:00+00:00' - description: End date of the current budget interval - budget_creator: - type: object - properties: - id: - $ref: '#/components/schemas/id_string' - name: - $ref: '#/components/schemas/name' - email: - $ref: '#/components/schemas/email' - example: - id: usq8rwZj2POy - name: John Brown - email: admin1@company.com amount_spent: type: number nullable: true @@ -7601,8 +8086,13 @@ components: nullable: true example: 50 description: Utilisation percentage of the budget interval - visibility: - $ref: '#/components/schemas/budget_visibility' + status: + $ref: '#/components/schemas/budget_status' + id_integer: + type: integer + description: | + This id is provided by Sage Exp Mgmt to identify an object. + example: 1234 code: type: string nullable: true @@ -7620,6 +8110,19 @@ components: project_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - sub_project + - display_name + - is_enabled + - code + - description + - category_ids + - default_billable properties: id: $ref: '#/components/schemas/id_integer' @@ -7662,9 +8165,24 @@ components: type: integer example: 16570 description: List of categories that are applicable for the project. + default_billable: + type: boolean + nullable: true + description: | + Default billable flag for expenses using this project. + `null` indicates the default is not set. cost_center_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - is_enabled + - code + - description properties: id: $ref: '#/components/schemas/id_integer' @@ -7689,6 +8207,18 @@ components: category_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - display_name + - code + - is_enabled + - name + - sub_category + - system_category + - restricted_project_ids properties: id: $ref: '#/components/schemas/id_integer' @@ -7745,6 +8275,25 @@ components: expense_field_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - seq + - field_name + - column_name + - type + - options + - default_value + - placeholder + - category_ids + - is_enabled + - is_custom + - is_mandatory + - code + - parent_field_id + - display_order properties: id: $ref: '#/components/schemas/id_integer' @@ -7815,9 +8364,26 @@ components: description: | This specifies the `id` of the parent expense field and denotes that the expense field is a dependent custom field. NOTE: `type` must be `DEPENDENT_SELECT`. example: 1234 + display_order: + type: integer + nullable: true + readOnly: true + description: | + The 1-based position of an enabled, non-dependent custom expense field in the organization's custom order. + example: 1 dependent_expense_field_values_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - parent_expense_field_id + - expense_field_id + - parent_expense_field_value + - expense_field_value + - is_enabled properties: id: $ref: '#/components/schemas/id_integer' @@ -7852,6 +8418,22 @@ components: mileage_rate_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - unit + - vehicle_type + - rate + - slab_rates + - is_enabled + - code + - vehicle_ownership + - vehicle_category + - fuel_type + - engine_capacity + - charging_location properties: id: $ref: '#/components/schemas/id_integer' @@ -7878,6 +8460,9 @@ components: type: array items: type: object + required: + - rate + - limit properties: rate: type: number @@ -7889,6 +8474,58 @@ components: $ref: '#/components/schemas/is_enabled' code: $ref: '#/components/schemas/code' + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Vehicle ownership for advanced mileage rates. `null` for basic mileage rates. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Vehicle category for advanced mileage rates. `null` for basic mileage rates. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Fuel type for advanced car mileage rates. `null` otherwise. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Engine capacity band for petrol, diesel, and LPG advanced car rates. An empty object for basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Charging location for advanced electric car mileage rates. `null` otherwise. user_id: type: string description: | @@ -7904,6 +8541,11 @@ components: org_out_embed: type: object additionalProperties: false + required: + - id + - name + - domain + - currency properties: id: $ref: '#/components/schemas/org_id' @@ -7919,9 +8561,20 @@ components: example: example.com currency: $ref: '#/components/schemas/currency' + email: + type: string + maxLength: 127 + example: john.doe@example.com + description: | + An immutable field that represents the email address of the employee. + Must be compliant with RFC 822. user_out_embed: type: object additionalProperties: false + required: + - id + - email + - full_name properties: id: allOf: @@ -7957,6 +8610,12 @@ components: my_profile_out: type: object additionalProperties: false + required: + - user_id + - org_id + - org + - user + - roles properties: user_id: $ref: '#/components/schemas/user_id' @@ -7973,6 +8632,17 @@ components: recently_used_fields_out: type: object additionalProperties: false + required: + - org_id + - user_id + - category_ids + - cost_center_ids + - project_ids + - start_locations + - locations + - end_locations + - vehicle_types + - currencies properties: user_id: $ref: '#/components/schemas/user_id' @@ -8045,6 +8715,17 @@ components: account_out: type: object additionalProperties: false + required: + - id + - created_at + - updated_at + - user_id + - type + - currency + - current_balance_amount + - tentative_balance_amount + - org_id + - category_id properties: id: allOf: @@ -8104,6 +8785,20 @@ components: department_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - sub_department + - is_enabled + - code + - description + - department_head_user_ids + - doc_url + - department_head_users + - display_name properties: id: $ref: '#/components/schemas/id_string' @@ -8175,6 +8870,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -8190,6 +8889,13 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - system_category + - name + - sub_category + - code + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -8221,6 +8927,12 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - name + - sub_project + - code + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -8252,6 +8964,9 @@ components: example: sdfd2391 account_out_embed: type: object + required: + - id + - type properties: id: allOf: @@ -8271,6 +8986,11 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - vehicle_type + - code + - rate properties: id: $ref: '#/components/schemas/id_integer' @@ -8284,10 +9004,66 @@ components: example: 10 nullable: true description: Amount (in Home currency) per unit. + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Vehicle ownership for advanced mileage rates. `null` for basic mileage rates. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Vehicle category for advanced mileage rates. `null` for basic mileage rates. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Fuel type for advanced car mileage rates. `null` otherwise. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Engine capacity band for petrol, diesel, and LPG advanced car rates. An empty object for basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Charging location for advanced electric car mileage rates. `null` otherwise. per_diem_rate_out_embed: type: object nullable: true additionalProperties: false + required: + - id + - name + - code properties: id: $ref: '#/components/schemas/id_integer' @@ -8423,13 +9199,34 @@ components: report_approval_out_embed: type: object additionalProperties: false + required: + - approver_user_id + - approver_user + - state properties: approver_user_id: allOf: - $ref: '#/components/schemas/id_string' + nullable: true + description: | + The user ID of the approver. This is null when approver_type is SYSTEM (auto-approval). example: usge49ielgel + approver_type: + type: string + enum: + - USER + - SYSTEM + description: | + Type of approver. + - USER: A human approver identified by approver_user_id + - SYSTEM: Automatic approval by the system (auto-approval feature). When approver_type is SYSTEM, approver_user_id is null. + example: USER approver_user: - $ref: '#/components/schemas/user_out_embed' + allOf: + - $ref: '#/components/schemas/user_out_embed' + nullable: true + description: | + The user object of the approver. This is null when approver_type is SYSTEM. state: type: string enum: @@ -8458,6 +9255,9 @@ components: - last_paid_at - reimbursement_id - reimbursement_seq_num + - amount + - last_verified_at + - approvals properties: id: anyOf: @@ -8546,6 +9346,11 @@ components: List of report_approval objects file_out_embed: type: object + required: + - id + - name + - type + - content_type properties: id: allOf: @@ -8581,6 +9386,9 @@ components: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string @@ -8588,6 +9396,9 @@ components: expense_verification_out_embed: type: object additionalProperties: false + required: + - verifier_user_id + - verifier_user properties: verifier_user_id: allOf: @@ -8617,6 +9428,12 @@ components: type: object additionalProperties: false nullable: true + required: + - id + - code + - name + - sub_department + - display_name properties: id: $ref: '#/components/schemas/id_string' @@ -8709,6 +9526,19 @@ components: type: object additionalProperties: false nullable: true + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department + - location + - title + - business_unit + - custom_fields + - flattened_custom_field properties: id: $ref: '#/components/schemas/id_string' @@ -8823,6 +9653,21 @@ components: - id - corporate_card_id - corporate_card_number + - corporate_card_nickname + - masked_corporate_card_number + - bank_name + - corporate_card_user_full_name + - amount + - currency + - spent_at + - posted_at + - status + - description + - foreign_currency + - foreign_amount + - merchant + - category + - matched_by properties: id: allOf: @@ -8867,6 +9712,11 @@ components: description: | String denoting the card holder's full name example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false amount: $ref: '#/components/schemas/amount' currency: @@ -8929,6 +9779,128 @@ components: description: | String denoting the email of the user who matched the card transaction to an expense. example: john.ooe@sage.com + matched_corporate_card_transaction_out_embed_new: + anyOf: + - type: object + additionalProperties: false + properties: {} + description: Empty object when no corporate card transaction is matched + - type: object + required: + - id + - corporate_card_id + - corporate_card_number + properties: + id: + allOf: + - $ref: '#/components/schemas/id_string' + example: btxnwownwrng + corporate_card_id: + allOf: + - $ref: '#/components/schemas/id_string' + example: bawownwrng + corporate_card_number: + $ref: '#/components/schemas/card_number' + corporate_card_nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: Business Card + corporate_card_cardholder_name: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the card holder's name + example: John Cena + capitalone_virtual_card_last_four: + type: string + nullable: true + description: | + Last four digits of capitalone virtual card. + example: '4521' + masked_corporate_card_number: + $ref: '#/components/schemas/card_number' + bank_name: + nullable: true + $ref: '#/components/schemas/bank_name' + corporate_card_user_full_name: + nullable: true + allOf: + - $ref: '#/components/schemas/name_nullable' + maxLength: 255 + description: | + String denoting the card holder's full name + example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false + amount: + $ref: '#/components/schemas/amount' + currency: + $ref: '#/components/schemas/currency' + spent_at: + allOf: + - $ref: '#/components/schemas/spent_at' + description: | + Signifies spent date of a card transaction. + This date cannot be in future. + posted_at: + nullable: true + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies post date of a card transaction. + This date cannot be in future. + status: + type: string + nullable: true + enum: + - PENDING + - POSTED + - null + example: PENDING + description: | + Signifies status of a card transaction. + description: + type: string + nullable: true + description: | + Holds the description of the card transaction + example: Team lunch + foreign_currency: + nullable: true + allOf: + - $ref: '#/components/schemas/foreign_currency' + foreign_amount: + nullable: true + allOf: + - $ref: '#/components/schemas/foreign_amount' + merchant: + nullable: true + allOf: + - $ref: '#/components/schemas/merchant' + description: | + String denoting the name of the vendor to which the card transaction was made. + Note: This is not same as the merchant added in Sage Exp Mgmt but just a string + category: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the category of the card transaction + Note: This is not same as the category added in Sage Exp Mgmt but just a string + example: Travel + matched_by: + type: string + nullable: true + description: | + String denoting the email of the user who matched the card transaction to an expense. + example: john.ooe@sage.com missing_mandatory_fields: type: object nullable: false @@ -9180,6 +10152,12 @@ components: example: 77.594566 commute_details: type: object + required: + - id + - distance + - distance_unit + - home_location + - work_location nullable: true description: | Commute details of the employee. This is used to deduct daily commute from the employee's mileage expenses. @@ -9248,12 +10226,18 @@ components: - source_account - tax_amount - tax_group_id + - calculated_tax_amount - is_billable - is_reimbursable - distance - distance_unit - mileage_calculated_distance - mileage_calculated_amount + - selected_vehicle_ownership + - selected_vehicle_category + - passenger_count + - passenger_mileage_rate + - passenger_amount - mileage_rate_id - mileage_rate - mileage_is_round_trip @@ -9272,6 +10256,7 @@ components: - seq_num - report_id - added_to_report_at + - added_to_report_by - report - is_verified - last_verified_at @@ -9284,6 +10269,8 @@ components: - is_corporate_card_transaction_auto_matched - matched_corporate_card_transaction_ids - matched_corporate_card_transactions + - matched_corporate_card_transaction_id + - matched_corporate_card_transaction - last_settled_at - missing_mandatory_fields - activity_details @@ -9297,6 +10284,26 @@ components: - invoice_number - is_duplicate_present - expense_policy_comments + - custom_fields_flattened + - approvals + - verifications + - employee_id + - split_group_amount + - expense_rule_id + - expense_rule_data + - is_split + - tax_group + - approver_comments + - verifier_comments + - policy_checks + - accounting_export_summary + - report_last_paid_at + - report_last_approved_at + - commute_deduction + - commute_details_id + - commute_details + - is_reconciled + - report_auto_approval_state properties: id: allOf: @@ -9419,6 +10426,12 @@ components: allOf: - $ref: '#/components/schemas/fk_string' nullable: true + calculated_tax_amount: + type: number + nullable: true + readOnly: true + description: | + System-derived tax amount for the expense amount and the selected tax group's rate. is_billable: type: boolean nullable: true @@ -9449,6 +10462,36 @@ components: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + selected_vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Selected vehicle ownership for an advanced mileage expense. `null` for a basic mileage expense. + selected_vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Selected vehicle category for an advanced mileage expense. `null` for a basic mileage expense. + passenger_count: + type: integer + nullable: true + description: Number of passengers carried on the mileage journey. + passenger_mileage_rate: + type: number + nullable: true + readOnly: true + description: Passenger mileage rate snapshot applied to this expense. `null` when passenger mileage does not apply. + passenger_amount: + type: number + nullable: true + description: Passenger mileage reimbursement amount for this expense. mileage_rate_id: allOf: - $ref: '#/components/schemas/fk_integer' @@ -9552,6 +10595,16 @@ components: description: | signifies when this expense was added to a report. If this expense is not added to a report, then this could be null. + added_to_report_by: + type: string + nullable: true + enum: + - USER + - SYSTEM + - null + description: | + Indicates whether the expense was added to the report it belongs to by a user or the system. If the expense is not a part of any report, this field will be null. + example: USER report: $ref: '#/components/schemas/report_out_embed' is_verified: @@ -9624,6 +10677,8 @@ components: $ref: '#/components/schemas/id_string' description: | Holds the corporate card transaction ids which are matched to this expense + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction_id` instead, as this array always contains a single value. example: - btxnwownwrng matched_corporate_card_transactions: @@ -9633,6 +10688,20 @@ components: description: | Holds the corporate card transactions which are matched to this expense. NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_ids` is already up-to-date. + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction` instead, as this array always contains a single value. + matched_corporate_card_transaction_id: + type: string + nullable: true + description: | + Holds the corporate card transaction id which is matched to this expense + example: btxnwownwrng + matched_corporate_card_transaction: + allOf: + - $ref: '#/components/schemas/matched_corporate_card_transaction_out_embed_new' + description: | + Holds the corporate card transaction which is matched to this expense. + NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_id` is already up-to-date. last_settled_at: allOf: - $ref: '#/components/schemas/timestamptz_utc' @@ -9801,6 +10870,15 @@ components: description: | Whether expenses is reconciled or not. example: true + report_auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the expense's report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null source: type: string description: | @@ -9889,8 +10967,6 @@ components: spender_expense_in: type: object additionalProperties: false - required: - - claim_amount properties: id: $ref: '#/components/schemas/id_string' @@ -10040,6 +11116,16 @@ components: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. commute_details_id: type: integer nullable: true @@ -10346,6 +11432,17 @@ components: per_diem_rate_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - is_enabled + - name + - currency + - rate + - code + - description properties: id: $ref: '#/components/schemas/id_integer' @@ -10377,6 +11474,11 @@ components: merchant_out: type: object additionalProperties: false + required: + - id + - created_at + - updated_at + - display_name properties: id: $ref: '#/components/schemas/id_integer' @@ -10397,6 +11499,13 @@ components: spender_subscriptions_out: type: object additionalProperties: false + required: + - id + - is_enabled + - webhook_url + - updated_at + - created_at + - user_id properties: id: $ref: '#/components/schemas/id_string' @@ -10424,6 +11533,18 @@ components: employee_out_embed_for_report: type: object additionalProperties: false + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department + - ach_account + - business_unit + - location + - title properties: id: $ref: '#/components/schemas/id_string' @@ -10567,6 +11688,12 @@ components: reimbursement_out_minimal: type: object nullable: true + required: + - id + - currency + - amount + - mode + - ach_transfer properties: id: type: string @@ -10593,6 +11720,10 @@ components: type: object nullable: true additionalProperties: false + required: + - id + - email + - full_name properties: id: allOf: @@ -10636,6 +11767,9 @@ components: advance_wallet_report_out: type: object additionalProperties: false + required: + - id + - amount properties: id: allOf: @@ -10673,6 +11807,16 @@ components: - reimbursement_id - reimbursement - comments + - creator_type + - is_verified + - is_physical_bill_submitted + - physical_bill_submitted_at + - is_exported + - employee_id + - state_display_name + - accounting_export_summary + - applied_advance_wallets + - auto_approval_state properties: id: $ref: '#/components/schemas/id_string' @@ -10872,6 +12016,23 @@ components: nullable: true description: | List of applied advance wallets + creator_type: + type: string + enum: + - USER + - SYSTEM + description: | + Indicates whether the report was created by a user or the system. + example: USER + auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null report_out_subscriptions_spender: type: object additionalProperties: false @@ -10911,6 +12072,9 @@ components: schedule_config: type: object nullable: false + required: + - type + - when properties: type: nullable: false @@ -10998,6 +12162,14 @@ components: schedule_out: type: object additionalProperties: false + required: + - id + - created_at + - updated_at + - config + - org_id + - user_id + - is_enabled properties: id: $ref: '#/components/schemas/id_string' @@ -11032,6 +12204,8 @@ components: example: TRANSACTION schedule_in: type: object + required: + - is_enabled properties: id: $ref: '#/components/schemas/id_string' @@ -11143,6 +12317,8 @@ components: id of report, which needs to be resubmitted example: rpa21A2rdj2 reports_stats_in: + required: + - query_params properties: query_params: type: string @@ -11343,6 +12519,16 @@ components: report_filters_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - is_shared + - name + - org_id + - query_string + - user_id + - sub_feature properties: id: allOf: @@ -11509,6 +12695,9 @@ components: example: state=eq.PAID reports_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -11534,6 +12723,8 @@ components: reports_export_config: type: object additionalProperties: true + required: + - type properties: type: type: string @@ -11556,6 +12747,10 @@ components: example: true separate_line_items_entry: type: object + required: + - enabled + - debit_entries_only + - credit_entries_only properties: enabled: type: boolean @@ -11584,6 +12779,9 @@ components: type: array items: type: object + required: + - name + - formula properties: name: type: string @@ -11600,6 +12798,17 @@ components: reports_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - file_id + - state + - query_params + - notify_emails + - config properties: created_at: $ref: '#/components/schemas/created_at' @@ -11671,6 +12880,12 @@ components: advance_out_embed: type: object nullable: true + required: + - id + - currency + - amount + - advance_request_id + - seq_num properties: id: type: string @@ -11699,6 +12914,11 @@ components: type: object description: | Advance request custom field + required: + - id + - name + - type + - value properties: name: type: string @@ -11746,6 +12966,10 @@ components: advance_request_approval_out_embed: type: object additionalProperties: false + required: + - approver_user_id + - approver_user + - state properties: approver_user_id: allOf: @@ -11762,9 +12986,39 @@ components: - APPROVAL_REJECTED description: | State of this advance request approval + department_out_employee_embed: + type: object + additionalProperties: false + nullable: true + required: + - id + - code + - name + - sub_department + properties: + id: + $ref: '#/components/schemas/id_string' + code: + $ref: '#/components/schemas/code' + name: + allOf: + - $ref: '#/components/schemas/name' + example: Sales + sub_department: + type: string + nullable: true + example: Outbound Sales employee_out_embed: type: object additionalProperties: false + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department properties: id: $ref: '#/components/schemas/id_string' @@ -11787,7 +13041,7 @@ components: $ref: '#/components/schemas/department_id' department: nullable: true - $ref: '#/components/schemas/department_out_embed' + $ref: '#/components/schemas/department_out_employee_embed' user_id_nullable: type: string description: | @@ -11795,9 +13049,16 @@ components: readOnly: true nullable: true example: uswjwgnwwgo - advance_request_comments_out: + advance_request_comments_out_embed: type: object additionalProperties: false + required: + - id + - comment + - creator_type + - creator_user_id + - creator_user + - created_at properties: id: $ref: '#/components/schemas/id_string' @@ -11805,12 +13066,6 @@ components: type: string description: A comment on the advance request example: Advance request was created - action: - type: string - description: Advance request action for which comment is added. - example: SUBMITTED - advance_request_id: - $ref: '#/components/schemas/id_string' creator_type: type: string description: Describes whether the comment is system-generated or User made. @@ -11825,13 +13080,37 @@ components: $ref: '#/components/schemas/user_out_embed_nullable' created_at: $ref: '#/components/schemas/created_at' - updated_at: - $ref: '#/components/schemas/updated_at' - org_id: - $ref: '#/components/schemas/org_id' advance_request_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - user_id + - org_id + - project_id + - advance_id + - seq_num + - currency + - amount + - last_approved_at + - notes + - purpose + - source + - state + - custom_fields + - user + - project + - advance + - approvals + - is_exported + - employee_id + - employee + - code + - comments + - file_ids + - files properties: id: allOf: @@ -11930,7 +13209,7 @@ components: comments: type: array items: - $ref: '#/components/schemas/advance_request_comments_out' + $ref: '#/components/schemas/advance_request_comments_out_embed' description: | List of comments in the advance request file_ids: @@ -11943,7 +13222,7 @@ components: type: array items: $ref: '#/components/schemas/file_out_embed' - advance_request_in: + advance_request_in_base: type: object properties: id: @@ -11981,7 +13260,16 @@ components: $ref: '#/components/schemas/fk_integer' custom_fields: $ref: '#/components/schemas/advance_request_custom_fields' + spender_advance_request_in: + allOf: + - $ref: '#/components/schemas/advance_request_in_base' + - type: object + required: + - currency + - amount advance_requests_stats_in: + required: + - query_params properties: query_params: description: | @@ -12067,6 +13355,10 @@ components: advance_request_out_embed: type: object nullable: true + required: + - id + - last_approved_at + - seq_num properties: id: type: string @@ -12091,6 +13383,36 @@ components: advance_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - advance_request_id + - user_id + - org_id + - project_id + - seq_num + - amount + - issued_at + - card_number + - currency + - custom_fields + - foreign_amount + - foreign_currency + - payment_mode + - purpose + - code + - source + - advance_account_id + - advance_wallet_id + - is_exported + - last_exported_at + - user + - project + - employee_id + - employee + - creator_user + - advance_request properties: id: allOf: @@ -12197,6 +13519,8 @@ components: creator_user: $ref: '#/components/schemas/user_out_embed_nullable' advances_stats_in: + required: + - query_params properties: query_params: type: string @@ -12206,6 +13530,9 @@ components: example: id=in.('adv1263', 'adv1569') advances_stats_out: type: object + required: + - count + - total_amount properties: count: type: integer @@ -12222,6 +13549,14 @@ components: advance_wallet_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - currency + - balance_amount properties: id: allOf: @@ -12385,6 +13720,23 @@ components: description: | Unique nickname assigned to the card example: Business Card + is_archived: + type: boolean + description: | + Indicates whether the corporate card is archived. + nullable: false + archived_at: + allOf: + - $ref: '#/components/schemas/timestamptz_utc' + description: | + Signifies when the card was archived + example: '2022-02-01T07:20:39.207250+00:00' + nullable: true + archived_by_user_id: + type: string + description: | + The unique id of an user who archived the card. + nullable: true total_transactions_count: type: integer nullable: false @@ -12424,6 +13776,8 @@ components: - virtual_card_id - virtual_card_state - nickname + - archived_at + - archived_by_user_id - total_transactions_count - unassigned_transactions_count yodlee_accounts_out: @@ -12504,6 +13858,30 @@ components: - yodlee_fastlink_params - created_at - updated_at + - corporate_card_id + corporate_card_rtf_monthly_enrollment_usage_out: + type: object + properties: + monthly_limit: + type: integer + default: 3 + description: | + The monthly limit for the RTF card enrollment usage. + example: 3 + enrolled_cards: + type: integer + description: | + The number of RTF cards enrolled in the current month. + example: 1 + is_limit_reached: + type: boolean + description: | + Indicates whether the monthly limit for RTF card enrollment usage has been reached. + example: false + required: + - monthly_limit + - enrolled_cards + - is_limit_reached string_detail: type: string description: Additional string details of the card transaction. Can hold details upto 256 characters in length. @@ -12512,6 +13890,15 @@ components: corporate_card_out_embed: type: object additionalProperties: false + required: + - id + - bank_name + - card_number + - nickname + - cardholder_name + - masked_number + - user_full_name + - user_email properties: id: allOf: @@ -12561,6 +13948,11 @@ components: description: | String denoting the card holder's email example: john.doe@example.com + is_archived: + type: boolean + description: | + Indicates whether the corporate card is archived. + nullable: false matched_expense_out_embed: type: object nullable: true @@ -12974,8 +14366,14 @@ components: - last_user_matched_at - is_exported - metadata + - transaction_status + - mcc + - bank_transaction_number + - capitalone_virtual_card_last_four corporate_card_transactions_expenses_stats_in: type: object + required: + - query_params properties: query_params: type: string @@ -13268,6 +14666,8 @@ components: - matched_expenses - last_user_matched_at - metadata + - mcc + - is_exported corporate_card_transaction_unmark_personal_out: type: object properties: @@ -13476,6 +14876,8 @@ components: - matched_expenses - last_user_matched_at - metadata + - mcc + - is_exported corporate_card_transaction_ignore_out: type: object properties: @@ -13690,6 +15092,9 @@ components: - matched_expenses - last_user_matched_at - metadata + - capitalone_virtual_card_last_four + - mcc + - is_exported corporate_card_transaction_undo_ignore_out: type: object additionalProperties: false @@ -13919,6 +15324,10 @@ components: - matched_expenses - last_user_matched_at - metadata + - transaction_status + - capitalone_virtual_card_last_four + - mcc + - bank_transaction_number corporate_card_transaction_match_in: type: object properties: @@ -14150,6 +15559,9 @@ components: - matched_expenses - last_user_matched_at - metadata + - capitalone_virtual_card_last_four + - mcc + - is_exported corporate_card_transaction_unmatch_in: type: object properties: @@ -14393,15 +15805,41 @@ components: - matched_expenses - last_user_matched_at - metadata + - transaction_status + - capitalone_virtual_card_last_four + - mcc + - bank_transaction_number + - is_exported user_full_name: type: string maxLength: 255 description: | String denoting the full name of an employee. example: Jon Snow + delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: + - ALL + - SUBMIT + - APPROVE + example: + - SUBMIT + - APPROVE delegatees: type: object additionalProperties: false + required: + - id + - type + - user_id + - email + - full_name + - start_at + - scopes properties: id: allOf: @@ -14441,9 +15879,26 @@ components: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true + scopes: + allOf: + - $ref: '#/components/schemas/delegation_access_scope' + nullable: true spender_employee_out: type: object additionalProperties: false + required: + - id + - user_id + - email + - full_name + - roles + - commute_details + - mobile + - is_mobile_verified + - sms_opt_out_source + - is_enabled + - has_accepted_invite + - delegatees properties: id: $ref: '#/components/schemas/id_string' @@ -14567,6 +16022,44 @@ components: Mileage settings of the employee. spender_employee_current_out: type: object + required: + - id + - org_id + - user_id + - created_at + - updated_at + - user + - code + - joined_at + - title + - business_unit + - special_email + - roles + - location + - is_enabled + - has_accepted_invite + - branch_account + - branch_ifsc + - department_id + - department + - level_id + - level + - mobile + - is_mobile_verified + - mobile_verification_attempts_left + - mobile_verification_attempted_at + - org_name + - currency + - approver_user_ids + - approver_users + - locale + - delegatees + - mileage_settings + - custom_fields + - flattened_custom_field + - commute_details_id + - commute_details + - is_primary additionalProperties: false properties: id: @@ -14640,7 +16133,7 @@ components: department_id: $ref: '#/components/schemas/fk_string' department: - $ref: '#/components/schemas/department_out_embed' + $ref: '#/components/schemas/department_out_employee_embed' level_id: $ref: '#/components/schemas/fk_string' level: @@ -14721,6 +16214,13 @@ components: commute_location_not_nullable: type: object nullable: false + required: + - city + - state + - country + - formatted_address + - latitude + - longitude properties: city: type: string @@ -14752,6 +16252,11 @@ components: additionalProperties: false description: | Commute details of the employee. This is used to deduct daily commute from the employee's mileage expenses. + required: + - distance + - distance_unit + - home_location + - work_location properties: home_location: allOf: @@ -14783,6 +16288,19 @@ components: spender_commute_details_out: type: object additionalProperties: false + required: + - id + - user_id + - email + - full_name + - roles + - commute_details + - mobile + - is_mobile_verified + - sms_opt_out_source + - is_enabled + - has_accepted_invite + - delegatees properties: id: $ref: '#/components/schemas/id_string' @@ -14840,6 +16358,10 @@ components: spender_delegatees_post_in: type: object additionalProperties: false + required: + - delegatee_user_id + - start_at + - end_at properties: delegatee_user_id: $ref: '#/components/schemas/fk_string' @@ -14855,9 +16377,26 @@ components: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: true + scopes: + allOf: + - $ref: '#/components/schemas/delegation_access_scope' + nullable: true spender_delegatees_post_out: type: object additionalProperties: false + required: + - id + - user_id + - email + - full_name + - roles + - commute_details + - mobile + - is_mobile_verified + - sms_opt_out_source + - is_enabled + - has_accepted_invite + - delegatees properties: id: $ref: '#/components/schemas/id_string' @@ -14915,6 +16454,10 @@ components: spender_delegators_out: type: object additionalProperties: false + required: + - user_id + - email + - full_name properties: user_id: $ref: '#/components/schemas/user_id' @@ -14929,6 +16472,13 @@ components: spender_delegatees_delete_out: type: object additionalProperties: false + required: + - id + - org_id + - delegator_user_id + - delegatee_user_id + - start_date + - end_date properties: id: $ref: '#/components/schemas/id_integer' @@ -14952,6 +16502,12 @@ components: $ref: '#/components/schemas/timestamptz_utc' employees_send_mobile_verification_code_post_out: type: object + required: + - to + - channel + - status + - date_created + - attempts_left additionalProperties: false properties: to: @@ -14969,11 +16525,6 @@ components: description: | Current status of the verification attempt example: pending - valid: - type: boolean - description: | - Whether the verification is valid - example: false date_created: type: string format: date-time @@ -15006,6 +16557,29 @@ components: spender_employee_settings_out: type: object additionalProperties: false + required: + - id + - employee_id + - org_id + - created_at + - updated_at + - category_ids + - cost_center_ids + - project_ids + - per_diem_rate_ids + - mileage_rate_ids + - insta_fyle_settings + - notification_settings + - mileage_settings + - expense_form_autofills + - data_extractor_settings + - in_app_chat_settings + - payment_mode_settings + - locale + - is_personal_cards_enabled + - default_project_id + - default_payment_mode + - default_vehicle_type properties: id: $ref: '#/components/schemas/id_string' @@ -15143,21 +16717,7 @@ components: example: true description: Whether to notify the delegatee about events mileage_settings: - type: object - nullable: true - additionalProperties: false - description: Settings for mileage tracking and rates - properties: - mileage_rate_labels: - type: object - nullable: true - example: null - description: Labels for different mileage rates - annual_mileage_of_user_before_joining_fyle: - type: object - nullable: true - example: {} - description: Annual mileage limit for user before joining Sage Exp Mgmt + $ref: '#/components/schemas/mileage_settings' expense_form_autofills: type: object nullable: true @@ -15241,20 +16801,24 @@ components: nullable: true additionalProperties: false description: Settings for user's locale and timezone + required: + - timezone + - abbreviation + - offset properties: timezone: type: string - nullable: true + nullable: false example: Asia/Kolkata description: User's timezone abbreviation: type: string - nullable: true + nullable: false example: IST description: Timezone abbreviation offset: type: string - nullable: true + nullable: false example: '05:30:00' description: Timezone offset from UTC is_personal_cards_enabled: @@ -15279,13 +16843,16 @@ components: spender_employee_settings_in: type: object additionalProperties: false + required: + - id + - employee_id properties: id: $ref: '#/components/schemas/id_string' - description: Unique identifier for the employee settings (optional) + description: Unique identifier for the employee settings employee_id: $ref: '#/components/schemas/id_string' - description: Unique identifier of the employee (optional) + description: Unique identifier of the employee cost_center_ids: type: array items: @@ -15313,22 +16880,35 @@ components: description: List of categories that the employee has access to locale: type: object + nullable: true additionalProperties: false description: Settings for user's locale and timezone + required: + - timezone + - abbreviation + - offset properties: timezone: type: string + nullable: false description: User's timezone abbreviation: type: string + nullable: false description: Timezone abbreviation offset: type: string + nullable: false description: Timezone offset from UTC insta_fyle_settings: type: object additionalProperties: false description: Settings for InstaFyle receipt scanning and data extraction + required: + - allowed + - enabled + - static_camera_overlay_enabled + - extract_fields properties: allowed: type: boolean @@ -15348,6 +16928,15 @@ components: type: object additionalProperties: false description: Settings for email and push notifications + required: + - email_allowed + - email_enabled + - email_unsubscribed_events + - push_allowed + - push_enabled + - push_unsubscribed_events + - notify_user + - notify_delegatee properties: email_allowed: type: boolean @@ -15381,6 +16970,9 @@ components: type: object additionalProperties: false description: Settings for automatic form filling in expenses + required: + - allowed + - enabled properties: allowed: type: boolean @@ -15392,6 +16984,9 @@ components: type: object additionalProperties: false description: Settings for data extraction from receipts + required: + - allowed + - enabled properties: allowed: type: boolean @@ -15403,6 +16998,9 @@ components: type: object additionalProperties: false description: Settings for in-app chat functionality + required: + - allowed + - enabled properties: allowed: type: boolean @@ -15418,6 +17016,10 @@ components: type: object additionalProperties: false description: Settings for payment modes + required: + - allowed + - enabled + - allowed_payment_modes properties: allowed: type: boolean @@ -15583,6 +17185,16 @@ components: tax_group_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - code + - name + - percentage + - is_enabled + - is_default properties: id: allOf: @@ -15607,6 +17219,11 @@ components: description: percentage of tax levied. is_enabled: $ref: '#/components/schemas/is_enabled' + is_default: + type: boolean + nullable: true + description: Indicates whether this tax group is the default for its percentage bucket. + example: false code: $ref: '#/components/schemas/code' file_in: @@ -15638,6 +17255,17 @@ components: file_out: type: object additionalProperties: false + required: + - id + - org_id + - user_id + - created_at + - updated_at + - name + - type + - content_type + - download_url + - upload_url properties: id: $ref: '#/components/schemas/id_string' @@ -15677,12 +17305,20 @@ components: Returns null if linked to an expense or advance request in approved or higher state. file_generate_urls_action_in: type: object + required: + - id properties: id: $ref: '#/components/schemas/id_string' file_generate_urls_action_out: type: object additionalProperties: false + required: + - id + - name + - content_type + - download_url + - upload_url properties: id: $ref: '#/components/schemas/id_string' @@ -15714,6 +17350,11 @@ components: file_out_download_url: type: object additionalProperties: false + required: + - id + - name + - content_type + - download_url properties: id: $ref: '#/components/schemas/id_string' @@ -15765,6 +17406,16 @@ components: - COMPANY_ACCOUNT - null example: PERSONAL_CASH_ACCOUNT + contains_from_list_operator: + nullable: true + type: string + enum: + - CONTAINS_ANY_FROM_LIST + - CONTAINS_NONE_FROM_LIST + - null + description: | + Value signifying the operator for matching values from a list field. + example: CONTAINS_ANY_FROM_LIST vehicle_type: type: string enum: @@ -15780,6 +17431,77 @@ components: expense_policy_out: type: object additionalProperties: true + required: + - created_at + - updated_at + - id + - org_id + - is_enabled + - is_retired + - description + - source + - creator_user_id + - creator_user + - approver_order + - is_approver_policy + - employee_department_ids + - employee_department_ids_op + - employee_level_ids + - employee_level_ids_op + - employee_titles + - employee_titles_op + - employee_user_ids + - employee_user_ids_op + - employee_custom_fields + - employee_custom_fields_op + - employee_locations + - employee_locations_op + - expense_category_ids + - expense_category_ids_op + - expense_limit_type + - expense_amount_max + - expense_amount_min + - expense_creation_delay_days_max + - expense_currency + - expense_without_receipt_allowed + - expense_allowed_distance_difference_percentage + - expense_flight_travel_class + - expense_project_ids + - expense_project_ids_op + - expense_train_travel_class + - expense_spent_at_max + - expense_spent_at_min + - expense_locations + - expense_locations_op + - expense_allowed_exchange_rate_difference_percentage + - expense_include_foreign_currency + - expense_annual_distance_max + - expense_vehicle_type + - expense_cost_center_ids + - expense_cost_center_ids_op + - expense_distance_max + - expense_distance_min + - expense_custom_fields + - expense_custom_fields_op + - expense_without_ccc_match_allowed + - expense_fiscal_start_month + - expense_payment_modes + - expense_payment_modes_op + - action_flag + - action_show_warning + - action_cap_amount + - action_make_unreportable + - action_remove_employee_approver1 + - action_add_employee_approver2 + - action_add_employee_approver3 + - action_add_project_approver1 + - action_add_project_approver2 + - action_add_department_head_approver + - action_add_approver_user_ids + - action_override_distance_slab_rate + - expense_merchants + - expense_merchants_op + - policy_violation_reason_required properties: id: allOf: @@ -16007,6 +17729,22 @@ components: nullable: true allOf: - $ref: '#/components/schemas/contains_operator' + expense_merchants: + nullable: true + type: array + items: + type: string + description: | + List of merchant names considered by this policy rule. + example: + - Uber + - Amazon + expense_merchants_op: + nullable: true + allOf: + - $ref: '#/components/schemas/contains_from_list_operator' + description: | + Operator to apply on `expense_merchants`. expense_without_ccc_match_allowed: type: boolean description: | @@ -16145,6 +17883,12 @@ components: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: false example: true + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule. + default: false + example: false action_make_unreportable: type: boolean description: | @@ -16233,6 +17977,11 @@ components: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: true + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false @@ -16274,6 +18023,11 @@ components: example: eq.ouNSnadfaLA expense_policy_expenses_query_object: type: object + required: + - limit_start_date + - limit_end_date + - params + nullable: true description: | An expense may be violating an expense policy rule due to a group of other expenses. These query params can be used to fetch those expenses because of which this expense is causing a violation.
@@ -16284,6 +18038,7 @@ components: description: | Spend start date query param to find the list of violating expenses. example: '2021-12-01' + nullable: true limit_end_date: type: string description: | @@ -16293,6 +18048,17 @@ components: $ref: '#/components/schemas/expense_policy_expenses_query_object_params' expense_policy_individual_desired_states: type: object + required: + - add_approver_user_ids + - approver_policy_order + - approver_source + - expense_id + - expense_policy_rule_id + - expense_policy_rule + - run_status + - run_result + - amount + - expenses_query_object properties: add_approver_user_ids: nullable: true @@ -16363,7 +18129,7 @@ components: description: | This represents the id of the expense policy rule. example: tprabsdfSYqd - rule: + expense_policy_rule: $ref: '#/components/schemas/expense_policy_rule_embed' amount: nullable: true @@ -16373,11 +18139,21 @@ components: description: | Amount that the policy calculation suggests for this expense. example: 500 - expenses_query_object_params: + expenses_query_object: nullable: true $ref: '#/components/schemas/expense_policy_expenses_query_object' expense_policy_final_desired_state: type: object + required: + - expense_id + - flag + - amount + - unreportable + - is_receipt_mandatory + - add_approver_user_ids + - remove_employee_approver1 + - run_status + - run_summary properties: expense_id: type: string @@ -16444,6 +18220,10 @@ components: expense_policy_states_out: type: object additionalProperties: false + required: + - expense_id + - individual_desired_states + - final_desired_state properties: expense_id: type: string @@ -16618,8 +18398,28 @@ components: type: number nullable: true description: Specific to mileage expense. Amount computed by Sage Exp Mgmt for mileage expenses. + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. expense_check_policies_individual_desired_states: type: object + required: + - add_approver_user_ids + - approver_policy_order + - approver_source + - expense_policy_rule_id + - expense_policy_rule + - run_status + - run_result + - amount + - expenses_query_object properties: add_approver_user_ids: nullable: true @@ -16694,11 +18494,20 @@ components: description: | Amount that the policy calculation suggests for this expense. example: 500 - expenses_query_object_params: + expenses_query_object: nullable: true $ref: '#/components/schemas/expense_policy_expenses_query_object' expense_check_policies_final_desired_state: type: object + required: + - flag + - amount + - unreportable + - is_receipt_mandatory + - add_approver_user_ids + - remove_employee_approver1 + - run_status + - run_summary properties: flag: type: boolean @@ -16760,6 +18569,9 @@ components: expense_check_policies_out: type: object additionalProperties: false + required: + - individual_desired_states + - final_desired_state properties: individual_desired_states: type: array @@ -16909,6 +18721,8 @@ components: - expense_details - schedule_config - is_enabled + - created_at + - updated_at properties: id: allOf: @@ -16931,8 +18745,8 @@ components: - MILEAGE: Mileage-based expense type example: EXPENSE expense_details: - type: object - nullable: false + allOf: + - $ref: '#/components/schemas/spender_expense_in' description: | Expense template details used for creating recurring expenses. Contains all the expense fields that will be applied to each generated expense. @@ -17072,6 +18886,16 @@ components: $ref: '#/components/schemas/distance' distance_unit: $ref: '#/components/schemas/distance_unit' + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. started_at: $ref: '#/components/schemas/timestamptz_pst' ended_at: @@ -17183,6 +19007,10 @@ components: - 12423 description: | List of IDs of expense fields which are mandatory but are missing. + expense_action_data_embed: + type: object + description: Data related to expense action. + nullable: true expense_comments_out: type: object additionalProperties: false @@ -17196,6 +19024,8 @@ components: - org_id - updated_at - created_at + - creator_user_id + - creator_user properties: id: $ref: '#/components/schemas/id_string' @@ -17228,9 +19058,7 @@ components: - UNMATCHED example: COMMENTED_WITH_NOTIFICATION action_data: - type: object - description: Data related to expense action. - nullable: true + $ref: '#/components/schemas/expense_action_data_embed' expense_id: $ref: '#/components/schemas/id_string' creator_type: @@ -17261,7 +19089,6 @@ components: required: - expense_id - comment - - notify properties: expense_id: $ref: '#/components/schemas/id_string' @@ -17295,6 +19122,8 @@ components: expense_duplicate_sets_out: type: object additionalProperties: false + required: + - expense_ids properties: expense_ids: type: array @@ -17307,6 +19136,8 @@ components: description: | List of expense IDs that are part of the duplicate set expenses_stats_in: + required: + - query_params properties: query_params: nullable: false @@ -17393,6 +19224,16 @@ components: expense_filters_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - name + - is_shared + - query_string + - sub_feature properties: id: allOf: @@ -17441,6 +19282,9 @@ components: example: exfilumWHrlPf7K expenses_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -17551,6 +19395,17 @@ components: expenses_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - notify_emails + - config + - file_id + - state properties: created_at: $ref: '#/components/schemas/created_at' @@ -17613,7 +19468,7 @@ components: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' is_reimbursable: $ref: '#/components/schemas/is_reimbursable' @@ -17690,7 +19545,7 @@ components: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' category_id: allOf: @@ -17891,9 +19746,23 @@ components: items: $ref: '#/components/schemas/any_type' - type: object + additionalProperties: + $ref: '#/components/schemas/any_type' + - {} feature_config_out: type: object additionalProperties: false + required: + - org_id + - user_id + - created_at + - updated_at + - target_client + - feature + - sub_feature + - key + - value + - is_shared properties: org_id: $ref: '#/components/schemas/org_id' @@ -17992,6 +19861,10 @@ components: order: 1 fastlink_params: type: object + required: + - configName + - flow + - providerAccountId nullable: true additionalProperties: false properties: @@ -18016,6 +19889,23 @@ components: personal_card_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - card_number + - bank_name + - currency + - account_type + - yodlee_account_id + - yodlee_login_id + - yodlee_last_synced_at + - yodlee_is_mfa_required + - yodlee_fastlink_params + - yodlee_is_credential_update_required + - yodlee_provider_account_id properties: id: $ref: '#/components/schemas/id_string' @@ -18043,10 +19933,6 @@ components: $ref: '#/components/schemas/fk_string' yodlee_fastlink_params: $ref: '#/components/schemas/fastlink_params' - type: object - nullable: true - description: | - Configuration to open Yodlee Fastlink yodlee_is_credential_update_required: type: boolean nullable: false @@ -18081,6 +19967,23 @@ components: personal_card_delete_out: type: object additionalProperties: false + required: + - id + - org_id + - user_id + - currency + - bank_name + - card_number + - account_type + - yodlee_account_id + - yodlee_fastlink_params + - yodlee_is_credential_update_required + - yodlee_is_mfa_required + - yodlee_last_synced_at + - yodlee_login_id + - yodlee_provider_account_id + - created_at + - updated_at properties: id: $ref: '#/components/schemas/id_string' @@ -18145,6 +20048,8 @@ components: $ref: '#/components/schemas/updated_at' personal_card_access_token_out: type: object + required: + - access_token properties: access_token: type: string @@ -18163,6 +20068,8 @@ components: example: baccymJEDziL9Y personal_card_mfa_out: type: object + required: + - is_mfa_enabled properties: is_mfa_enabled: type: boolean @@ -18172,6 +20079,25 @@ components: description: Determines wether the user card has MFA enabled or not personal_card_transaction_out: type: object + required: + - id + - org_id + - user_id + - personal_card_id + - amount + - currency + - spent_at + - category + - merchant + - state + - description + - external_transaction_id + - matched_expense_ids + - created_at + - updated_at + - foreign_amount + - foreign_currency + - matched_expenses additionalProperties: false properties: id: @@ -18192,66 +20118,167 @@ components: example: 1984.18 currency: type: string - maxLength: 3 - example: USD - description: Currency code (must be three letters only) - foreign_amount: + maxLength: 3 + example: USD + description: Currency code (must be three letters only) + foreign_amount: + nullable: true + foreign_currency: + nullable: true + spent_at: + allOf: + - $ref: '#/components/schemas/timestamptz_pst' + description: | + It signifies when this expense was made. + This date cannot be in future. + category: + type: string + example: Securities Trades + merchant: + type: string + example: Vanguard Target Retirement + state: + type: string + enum: + - INITIALIZED + - HIDDEN + - MATCHED + description: | + Status of Personal Card Transactions. + example: INITIALIZED + description: + $ref: '#/components/schemas/description' + external_transaction_id: + type: string + description: | + This id is provided by Yodlee to identify an object. + example: '2389782392032' + matched_expense_ids: + type: array + items: + $ref: '#/components/schemas/id_string' + description: | + Holds the expense ids which are matched to this card transaction + example: + - txwownwrng + matched_expenses: + type: array + items: + $ref: '#/components/schemas/matched_expense_out_embed' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + personal_card_transaction_hide_in: + type: object + required: + - id + additionalProperties: false + properties: + id: + $ref: '#/components/schemas/id_string' + employee_out_embed_for_expense_with_department_name: + type: object + additionalProperties: false + nullable: true + required: + - id + - user_id + - user + - code + - org_id + - org_name + - department_id + - department + - level + - location + - title + - business_unit + - custom_fields + - flattened_custom_field + - has_accepted_invite + - is_enabled + properties: + id: + $ref: '#/components/schemas/id_string' + user_id: + $ref: '#/components/schemas/user_id' + user: + $ref: '#/components/schemas/user_out_embed' + code: + type: string + maxLength: 255 + nullable: true + example: E84122 + description: | + This field refers to any string that the client programs can use to refer to an employee's unique id. + This could be any field such as an UUID from an Active Directory server or employee id in a HRMS system. + org_id: + $ref: '#/components/schemas/org_id' + org_name: + $ref: '#/components/schemas/org_name' + department_id: + nullable: true + $ref: '#/components/schemas/department_id' + department: + nullable: true + $ref: '#/components/schemas/department_out_embed' + level: + $ref: '#/components/schemas/level_out_embed' + location: + type: string + maxLength: 255 + nullable: true + example: Bangalore Ofc + title: + type: string + maxLength: 255 nullable: true - foreign_currency: + example: Branch Manager + business_unit: + type: string + maxLength: 255 + nullable: true + example: Finance ops + custom_fields: + type: array nullable: true - spent_at: - allOf: - - $ref: '#/components/schemas/timestamptz_pst' description: | - It signifies when this expense was made. - This date cannot be in future. - category: - type: string - example: Securities Trades - merchant: - type: string - example: Vanguard Target Retirement - state: - type: string - enum: - - INITIALIZED - - HIDDEN - - MATCHED + Custom fields + items: + $ref: '#/components/schemas/custom_field' + flattened_custom_field: + $ref: '#/components/schemas/flattened_custom_field' + has_accepted_invite: + $ref: '#/components/schemas/has_accepted_invite' + is_enabled: + allOf: + - $ref: '#/components/schemas/is_enabled' description: | - Status of Personal Card Transactions. - example: INITIALIZED - description: - $ref: '#/components/schemas/description' - external_transaction_id: + This field indicates whether the employee is enabled in the org. + mobile: type: string - description: | - This id is provided by Yodlee to identify an object. - example: '2389782392032' - matched_expense_ids: - type: array + nullable: true + example: '+12131234567' items: - $ref: '#/components/schemas/id_string' + $ref: '#/components/schemas/phone_number' description: | - Holds the expense ids which are matched to this card transaction - example: - - txwownwrng - matched_expenses: - type: array - items: - $ref: '#/components/schemas/matched_expense_out_embed' - created_at: - $ref: '#/components/schemas/created_at' - updated_at: - $ref: '#/components/schemas/updated_at' - personal_card_transaction_hide_in: - type: object - required: - - id - additionalProperties: false - properties: - id: - $ref: '#/components/schemas/id_string' + Mobile number of the employee + joined_at: + $ref: '#/components/schemas/joined_at' + description: | + NOTE: The data of this field is not realtime. It will get updated later even if `employee_id` is already up-to-date. + expense_out_with_department_name: + allOf: + - $ref: '#/components/schemas/expense_out' + - type: object + properties: + employee: + nullable: true + $ref: '#/components/schemas/employee_out_embed_for_expense_with_department_name' personal_card_transactions_stats_in: + required: + - query_params properties: query_params: nullable: false @@ -18262,6 +20289,10 @@ components: example: personal_card_id=eq.bacctW9DfNhwOt&state=eq.HIDDEN personal_card_transactions_stats_out: type: object + required: + - count + - debit_amount + - credit_amount properties: count: type: integer @@ -18284,6 +20315,15 @@ components: get_spender_orgs_out: type: object additionalProperties: false + required: + - id + - name + - domain + - currency + - created_at + - updated_at + - is_current + - is_primary properties: id: $ref: '#/components/schemas/org_id' @@ -18312,6 +20352,9 @@ components: spender_org_bank_details_out: type: object additionalProperties: false + required: + - org_id + - is_bank_account_added properties: org_id: $ref: '#/components/schemas/org_id' @@ -18319,6 +20362,13 @@ components: type: boolean example: true description: This field contains a boolean value indicating if a bank account has been added to the organisation. + advance_request_submit_in: + allOf: + - $ref: '#/components/schemas/advance_request_in_base' + - type: object + required: + - currency + - amount advance_request_permissions_in: type: object additionalProperties: false @@ -18332,6 +20382,18 @@ components: advance_request_permissions_out: type: object additionalProperties: false + required: + - can_save + - can_submit + - can_edit + - can_add_approver + - can_disable_approver + - can_reject + - can_approve + - can_inquire + - can_pull_back + - can_pay + - can_delete properties: can_save: type: boolean @@ -18394,6 +20456,7 @@ components: description: | Comment explaining the reason for pulling back the advance request example: sending back + nullable: true attach_files_to_advance_request_in: type: object required: @@ -18426,6 +20489,51 @@ components: type: string description: Comment text to be added to the advance request example: test + advance_request_comments_out: + type: object + additionalProperties: false + required: + - id + - comment + - action + - advance_request_id + - creator_type + - creator_user_id + - creator_user + - created_at + - updated_at + - org_id + properties: + id: + $ref: '#/components/schemas/id_string' + comment: + type: string + description: A comment on the advance request + example: Advance request was created + action: + type: string + description: Advance request action for which comment is added. + example: SUBMITTED + advance_request_id: + $ref: '#/components/schemas/id_string' + creator_type: + type: string + description: Describes whether the comment is system-generated or User made. + enum: + - SYSTEM + - POLICY + - USER + example: USER + creator_user_id: + $ref: '#/components/schemas/user_id_nullable' + creator_user: + $ref: '#/components/schemas/user_out_embed_nullable' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + org_id: + $ref: '#/components/schemas/org_id' advance_request_delete_in: type: object required: @@ -18437,6 +20545,14 @@ components: example: adrkvnwrnpwi secondary_email_out: type: object + required: + - id + - email + - is_verified + - org_id + - user_id + - created_at + - updated_at additionalProperties: false properties: id: @@ -18495,6 +20611,17 @@ components: advance_request_custom_field_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - type + - options + - is_mandatory + - is_enabled + - placeholder properties: id: type: integer @@ -18964,6 +21091,10 @@ components: example: GET(merchant) expenses_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -18987,7 +21118,7 @@ components: type: object additionalProperties: true properties: - is_column_header_included: + is_header_visible: type: boolean description: | Whether to include column headers in the export file. Required for CSV and EXCEL export types. @@ -19023,6 +21154,17 @@ components: expenses_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -19038,16 +21180,6 @@ components: $ref: '#/components/schemas/created_at' updated_at: $ref: '#/components/schemas/updated_at' - created_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | @@ -19121,9 +21253,9 @@ components: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature expenses_export_configuration_in_only_id: type: object required: @@ -19191,6 +21323,10 @@ components: example: GET(employee, user, full_name) reports_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -19245,6 +21381,17 @@ components: reports_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -19260,16 +21407,6 @@ components: $ref: '#/components/schemas/created_at' updated_at: $ref: '#/components/schemas/updated_at' - created_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: '#/components/schemas/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | @@ -19343,9 +21480,9 @@ components: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature reports_export_configuration_in_only_id: type: object required: @@ -19354,6 +21491,101 @@ components: properties: id: $ref: '#/components/schemas/id_string' + os: + type: object + additionalProperties: false + properties: + name: + type: string + enum: + - IOS + - ANDROID + description: Operating system name + example: IOS + version: + type: string + description: Operating system version + example: 17.0.0 + mobile_app_version_out: + type: object + additionalProperties: false + required: + - id + - user_id + - version + - os + - created_at + - updated_at + properties: + id: + type: string + description: Unique identifier for the mobile app version entry + example: appXYZ1234567 + user_id: + $ref: '#/components/schemas/user_id' + version: + type: string + description: Mobile app version + example: 8.0.1 + os: + $ref: '#/components/schemas/os' + created_at: + $ref: '#/components/schemas/created_at' + updated_at: + $ref: '#/components/schemas/updated_at' + mobile_app_version_in: + type: object + additionalProperties: false + required: + - version + - os + properties: + version: + type: string + description: Mobile app version + example: 8.0.1 + os: + $ref: '#/components/schemas/os' + rating_prompt_state_out: + type: object + additionalProperties: false + properties: + last_rating_pre_prompt_dismiss_at: + type: string + format: date-time + nullable: true + description: | + When the user last dismissed the pre-prompt (native rating prompt not shown). Used for cooldown. + last_native_review_prompt_at: + type: string + format: date-time + nullable: true + description: | + When the client last invoked the OS in-app review API after the user accepted the pre-prompt. + Used for cooldown. + updated_at: + type: string + format: date-time + nullable: true + description: | + Server time of the last persisted update. Null when no row exists yet for the user. + created_at: + type: string + format: date-time + nullable: true + description: | + Server time when the row was first created for the user. Null when no row exists yet. + rating_prompt_state_in: + type: object + additionalProperties: false + required: + - is_pre_prompt_dismissed + properties: + is_pre_prompt_dismissed: + type: boolean + description: | + `true` if the user dismissed the pre-prompt (native rating prompt was not shown); `false` if the native + rating prompt was shown. The server records the corresponding timestamp at request time using server UTC time. parameters: q: in: query diff --git a/reference/super_admin.yaml b/reference/super_admin.yaml index f9bb9d177..62716ddb2 100644 --- a/reference/super_admin.yaml +++ b/reference/super_admin.yaml @@ -134,7 +134,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: https://app.fylehq.com/app/developers/#/oauth/authorize + authorizationUrl: https://app.fylehq.com/app/developers/oauth/authorize tokenUrl: https://accounts.fylehq.com/oauth/token scopes: '*': Grant all actions diff --git a/src/accountant/openapi.yaml b/src/accountant/openapi.yaml index ff21fd23c..3f0544412 100644 --- a/src/accountant/openapi.yaml +++ b/src/accountant/openapi.yaml @@ -18,7 +18,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' diff --git a/src/accountant/paths/accountant@orgs.yaml b/src/accountant/paths/accountant@orgs.yaml index ac64ce6c8..51808c448 100644 --- a/src/accountant/paths/accountant@orgs.yaml +++ b/src/accountant/paths/accountant@orgs.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/openapi.yaml b/src/admin/openapi.yaml index 4d9279d76..44fb4d0c4 100644 --- a/src/admin/openapi.yaml +++ b/src/admin/openapi.yaml @@ -18,7 +18,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' @@ -155,6 +155,10 @@ paths: $ref: paths/admin@cost_centers.yaml /admin/cost_centers/bulk: $ref: paths/admin@cost_centers@bulk.yaml + /admin/cost_centers/delete/bulk: + $ref: paths/admin@cost_centers@delete@bulk.yaml + /admin/cost_centers/delete_summary/bulk: + $ref: paths/admin@cost_centers@delete_summary@bulk.yaml /admin/categories: $ref: paths/admin@categories.yaml /admin/categories/bulk: @@ -167,6 +171,8 @@ paths: $ref: paths/admin@categories@system_categories.yaml /admin/expense_fields: $ref: paths/admin@expense_fields.yaml + /admin/expense_fields/reorder: + $ref: paths/admin@expense_fields@reorder.yaml /admin/dependent_expense_field_values: $ref: paths/admin@dependent_expense_field_values.yaml /admin/dependent_expense_field_values/bulk: @@ -183,12 +189,30 @@ paths: $ref: paths/admin@per_diem_rates.yaml /admin/per_diem_rates/bulk: $ref: paths/admin@per_diem_rates@bulk.yaml + /admin/per_diem_rates/delete/bulk: + $ref: paths/admin@per_diem_rates@delete@bulk.yaml + /admin/per_diem_rates/delete_summary/bulk: + $ref: paths/admin@per_diem_rates@delete_summary@bulk.yaml /admin/departments: $ref: paths/admin@departments.yaml + /admin/departments/delete/bulk: + $ref: paths/admin@departments@delete@bulk.yaml + /admin/departments/delete_summary/bulk: + $ref: paths/admin@departments@delete_summary@bulk.yaml /admin/mileage_rates: $ref: paths/admin@mileage_rates.yaml + /admin/mileage_rates/bulk: + $ref: paths/admin@mileage_rates@bulk.yaml + /admin/mileage_rates/delete/bulk: + $ref: paths/admin@mileage_rates@delete@bulk.yaml + /admin/mileage_rates/delete_summary/bulk: + $ref: paths/admin@mileage_rates@delete_summary@bulk.yaml /admin/levels: $ref: paths/admin@levels.yaml + /admin/levels/delete/bulk: + $ref: paths/admin@levels@delete@bulk.yaml + /admin/levels/delete_summary/bulk: + $ref: paths/admin@levels@delete_summary@bulk.yaml /admin/employees: $ref: paths/admin@employees.yaml /admin/employees/stats: @@ -243,6 +267,8 @@ paths: $ref: paths/admin@accounting_export_lineitems@bulk.yaml /admin/expenses: $ref: paths/admin@expenses.yaml + /admin/expenses/bulk: + $ref: paths/admin@expenses@bulk.yaml /admin/expenses/attach_files/bulk : $ref: paths/admin@expenses@attach_files@bulk.yaml /admin/expenses/accounting_export_summary/bulk: @@ -255,6 +281,8 @@ paths: $ref: paths/admin@expenses@verify@bulk.yaml /admin/expenses/stats: $ref: paths/admin@expenses@stats.yaml + /admin/expenses/count: + $ref: paths/admin@expenses@count.yaml /admin/expenses/exports: $ref: paths/admin@expenses@exports.yaml /admin/expenses/export_configurations: @@ -315,6 +343,10 @@ paths: $ref: 'paths/admin@reports@admin_approve@bulk.yaml' /admin/reports/send_back: $ref: 'paths/admin@reports@send_back.yaml' + /admin/reports/revert_to_processing: + $ref: 'paths/admin@reports@revert_to_processing.yaml' + /admin/reports/revert_to_approved: + $ref: 'paths/admin@reports@revert_to_approved.yaml' /admin/reports/process_ach/bulk: $ref: paths/admin@reports@process_ach@bulk.yaml /admin/reports/mark_paid/bulk: @@ -329,6 +361,8 @@ paths: $ref: paths/admin@reports@stats.yaml /admin/reports/create_and_submit: $ref: paths/admin@reports@create_and_submit.yaml + /admin/reports/resubmit: + $ref: paths/admin@reports@resubmit.yaml /admin/reports/permissions: $ref: paths/admin@reports@permissions.yaml /admin/reports/apply_advance_wallets: @@ -361,6 +395,22 @@ paths: $ref: paths/admin@corporate_cards@reassign.yaml /admin/corporate_cards/delete: $ref: paths/admin@corporate_cards@delete.yaml + /admin/corporate_cards/merge: + $ref: paths/admin@corporate_cards@merge.yaml + /admin/corporate_cards/archive: + $ref: paths/admin@corporate_cards@archive.yaml + /admin/corporate_cards/unarchive: + $ref: paths/admin@corporate_cards@unarchive.yaml + /admin/corporate_cards/unarchive/bulk: + $ref: paths/admin@corporate_cards@unarchive@bulk.yaml + /admin/corporate_cards/duplicate_suggestions: + $ref: paths/admin@corporate_cards@duplicate_suggestions.yaml + /admin/corporate_cards/duplicate_suggestions/dismiss: + $ref: paths/admin@corporate_cards@duplicate_suggestions@dismiss.yaml + /admin/corporate_cards/archive_suggestions: + $ref: paths/admin@corporate_cards@archive_suggestions.yaml + /admin/corporate_cards/archive_suggestions/dismiss: + $ref: paths/admin@corporate_cards@archive_suggestions@dismiss.yaml /admin/corporate_card_transactions: $ref: paths/admin@corporate_card_transactions.yaml @@ -464,8 +514,12 @@ paths: $ref: 'paths/admin@budgets.yaml' /admin/budget_usages: $ref: paths/admin@budget_usages.yaml + /admin/budgets/export: + $ref: paths/admin@budgets@exports.yaml /admin/orgs: $ref: paths/admin@orgs.yaml + /admin/orgs/weekly_invitation_usage: + $ref: paths/admin@orgs@weekly_invitation_usage.yaml /admin/expense_policy_rules: $ref: paths/admin@expense_policies.yaml /admin/expense_policy_rules/enable: @@ -504,6 +558,10 @@ paths: $ref: paths/admin@statements@create_card_transactions.yaml /admin/statements/rtf_stats: $ref: paths/admin@statements@rtf_stats.yaml + /admin/statements/archived_cards: + $ref: paths/admin@statements@archived_cards.yaml + /admin/statements/archived_cards/ignore: + $ref: paths/admin@statements@archived_cards@ignore.yaml /admin/expense_rules: $ref: paths/admin@expense_rules.yaml /admin/expense_rules/dismiss_suggestion: @@ -512,6 +570,10 @@ paths: $ref: paths/admin@expense_rules@delete.yaml /admin/expenses/check_mandatory_fields: $ref: paths/admin@expenses@check_mandatory_fields.yaml + /admin/expenses/check_mandatory_fields/bulk: + $ref: paths/admin@expenses@check_mandatory_fields_bulk.yaml + /admin/expenses/check_policies/bulk: + $ref: paths/admin@expenses@check_policies_bulk.yaml /admin/expenses/comments: $ref: paths/admin@expenses@comments.yaml /admin/expenses/comments/bulk: @@ -542,14 +604,32 @@ paths: $ref: paths/admin@reconciliation_entries@create.yaml /admin/reconciliation_entries/transactions: $ref: paths/admin@reconciliation_entries@transactions.yaml + /admin/reconciliation_entries/transactions/reconcile/bulk: + $ref: paths/admin@reconciliation_entries@transactions@reconcile@bulk.yaml + /admin/reconciliation_entries/transactions/match_and_reconcile/bulk: + $ref: paths/admin@reconciliation_entries@transactions@match_and_reconcile@bulk.yaml + /admin/reconciliation_entries/transactions/find_match: + $ref: paths/admin@reconciliation_entries@transactions@find_match.yaml + /admin/reconciliation_entries/transactions/stats: + $ref: paths/admin@reconciliation_entries@transactions@stats.yaml /admin/reconciliation_entries/eligible_cards: $ref: paths/admin@reconciliation_entries@eligible_cards.yaml /admin/reconciliation_entries/eligible_cards/stats: $ref: paths/admin@reconciliation_entries@eligible_cards@stats.yaml - /admin/reconciliation_entries/transactions/stats: - $ref: paths/admin@reconciliation_entries@transactions@stats.yaml + /admin/reconciliation_entries/eligible_cards/exports: + $ref: paths/admin@reconciliation_entries@eligible_cards@exports.yaml + /admin/reconciliation_entries/transactions/delete/bulk: + $ref: paths/admin@reconciliation_entries@transactions@delete@bulk.yaml + /admin/reconciliation_entries/transactions/unmatch/bulk: + $ref: paths/admin@reconciliation_entries@transactions@unmatch@bulk.yaml /admin/reconciliation_entries/transactions/move_to_next_period/bulk: $ref: paths/admin@reconciliation_entries@transactions@move_to_next_period@bulk.yaml + /admin/reconciliation_entries/transactions/resolve_multi_matches: + $ref: paths/admin@reconciliation_entries@transactions@resolve_multi_matches.yaml + /admin/reconciliation_entries/transactions/exports: + $ref: paths/admin@reconciliation_entries@transactions@exports.yaml + /admin/reconciliation_entries/close: + $ref: paths/admin@reconciliation_entries@close.yaml /admin/expenses/delete/bulk: $ref: paths/admin@expenses@delete@bulk.yaml /admin/employee_settings: diff --git a/src/admin/paths/admin@accounting_export_lineitems.yaml b/src/admin/paths/admin@accounting_export_lineitems.yaml index 63ac40987..dfb06f7d5 100644 --- a/src/admin/paths/admin@accounting_export_lineitems.yaml +++ b/src/admin/paths/admin@accounting_export_lineitems.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -61,6 +65,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/accounting_export_lineitem.yaml#/accounting_export_lineitem_out diff --git a/src/admin/paths/admin@accounting_exports.yaml b/src/admin/paths/admin@accounting_exports.yaml index f8d793701..b65f01698 100644 --- a/src/admin/paths/admin@accounting_exports.yaml +++ b/src/admin/paths/admin@accounting_exports.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -61,6 +65,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/accounting_export.yaml#/accounting_export_out diff --git a/src/admin/paths/admin@accounts.yaml b/src/admin/paths/admin@accounts.yaml index 616395a0e..39ddc6b8e 100644 --- a/src/admin/paths/admin@accounts.yaml +++ b/src/admin/paths/admin@accounts.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -61,6 +65,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/account.yaml#/account_out' diff --git a/src/admin/paths/admin@adjustments.yaml b/src/admin/paths/admin@adjustments.yaml index 1c2c089cd..12933157f 100644 --- a/src/admin/paths/admin@adjustments.yaml +++ b/src/admin/paths/admin@adjustments.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@advance_refunds.yaml b/src/admin/paths/admin@advance_refunds.yaml index 805eeaa98..f1508b5b8 100644 --- a/src/admin/paths/admin@advance_refunds.yaml +++ b/src/admin/paths/admin@advance_refunds.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -66,6 +70,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_refund.yaml#/advance_refund_out' diff --git a/src/admin/paths/admin@advance_refunds@stats.yaml b/src/admin/paths/admin@advance_refunds@stats.yaml index 7c0f8062c..be42f477c 100644 --- a/src/admin/paths/admin@advance_refunds@stats.yaml +++ b/src/admin/paths/admin@advance_refunds@stats.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/admin/paths/admin@advance_requests.yaml b/src/admin/paths/admin@advance_requests.yaml index 6ec146b02..6b447d513 100644 --- a/src/admin/paths/admin@advance_requests.yaml +++ b/src/admin/paths/admin@advance_requests.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -57,7 +61,7 @@ post: - data properties: data: - $ref: '../../components/schemas/advance_request.yaml#/advance_request_in' + $ref: '../../components/schemas/advance_request.yaml#/admin_advance_request_in' responses: '200': description: OK @@ -66,6 +70,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/admin/paths/admin@advance_requests@add_approver.yaml b/src/admin/paths/admin@advance_requests@add_approver.yaml index 56de6b4b5..1128508d7 100644 --- a/src/admin/paths/admin@advance_requests@add_approver.yaml +++ b/src/admin/paths/admin@advance_requests@add_approver.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_add_approver_in' @@ -26,6 +28,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/admin/paths/admin@advance_requests@bulk_attach_file.yaml b/src/admin/paths/admin@advance_requests@bulk_attach_file.yaml index 14065e4b1..8da910c34 100644 --- a/src/admin/paths/admin@advance_requests@bulk_attach_file.yaml +++ b/src/admin/paths/admin@advance_requests@bulk_attach_file.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@advance_requests@comments.yaml b/src/admin/paths/admin@advance_requests@comments.yaml index 4bac5d7f9..c4d14ca36 100644 --- a/src/admin/paths/admin@advance_requests@comments.yaml +++ b/src/admin/paths/admin@advance_requests@comments.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_comments_in' @@ -21,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_comments_out' diff --git a/src/admin/paths/admin@advance_requests@custom_fields.yaml b/src/admin/paths/admin@advance_requests@custom_fields.yaml index 3dfc401ea..cac7f388f 100644 --- a/src/admin/paths/admin@advance_requests@custom_fields.yaml +++ b/src/admin/paths/admin@advance_requests@custom_fields.yaml @@ -12,6 +12,8 @@ get: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_custom_fields_out' @@ -64,6 +66,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_custom_field_out' diff --git a/src/admin/paths/admin@advance_requests@inquire.yaml b/src/admin/paths/admin@advance_requests@inquire.yaml index 7edb2e29b..939704db3 100644 --- a/src/admin/paths/admin@advance_requests@inquire.yaml +++ b/src/admin/paths/admin@advance_requests@inquire.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/admin/paths/admin@advance_requests@permissions.yaml b/src/admin/paths/admin@advance_requests@permissions.yaml index 744da3b9f..8f5d4031b 100644 --- a/src/admin/paths/admin@advance_requests@permissions.yaml +++ b/src/admin/paths/admin@advance_requests@permissions.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_permissions_out' diff --git a/src/admin/paths/admin@advance_requests@reject.yaml b/src/admin/paths/admin@advance_requests@reject.yaml index b3e8c6577..4ef47efba 100644 --- a/src/admin/paths/admin@advance_requests@reject.yaml +++ b/src/admin/paths/admin@advance_requests@reject.yaml @@ -29,6 +29,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/admin/paths/admin@advance_requests@remove_approver.yaml b/src/admin/paths/admin@advance_requests@remove_approver.yaml index 916bb571e..749d58844 100644 --- a/src/admin/paths/admin@advance_requests@remove_approver.yaml +++ b/src/admin/paths/admin@advance_requests@remove_approver.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_remove_approver_in' @@ -25,6 +27,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/admin/paths/admin@advance_requests@stats.yaml b/src/admin/paths/admin@advance_requests@stats.yaml index f8899cb51..34b7bc4fe 100644 --- a/src/admin/paths/admin@advance_requests@stats.yaml +++ b/src/admin/paths/admin@advance_requests@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_requests_stats_out' diff --git a/src/admin/paths/admin@advance_requests@submit.yaml b/src/admin/paths/admin@advance_requests@submit.yaml index 8abfe8cf7..287fae1b2 100644 --- a/src/admin/paths/admin@advance_requests@submit.yaml +++ b/src/admin/paths/admin@advance_requests@submit.yaml @@ -16,7 +16,7 @@ post: - data properties: data: - $ref: '../../components/schemas/advance_request.yaml#/advance_request_in' + $ref: '../../components/schemas/advance_request.yaml#/advance_request_submit_in' responses: '200': description: OK @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' @@ -61,4 +63,4 @@ post: message: type: string description: | - This error means the requested resource was not found or the requester doesn't have sufficient access. \ No newline at end of file + This error means the requested resource was not found or the requester doesn't have sufficient access. diff --git a/src/admin/paths/admin@advance_wallets.yaml b/src/admin/paths/admin@advance_wallets.yaml index 6ab0c2d4c..9dd1379ea 100644 --- a/src/admin/paths/admin@advance_wallets.yaml +++ b/src/admin/paths/admin@advance_wallets.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -66,6 +70,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_wallet.yaml#/advance_wallet_out' diff --git a/src/admin/paths/admin@advances.yaml b/src/admin/paths/admin@advances.yaml index 1cd099375..b9d19a5b7 100644 --- a/src/admin/paths/admin@advances.yaml +++ b/src/admin/paths/admin@advances.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -66,6 +70,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance.yaml#/advance_out' diff --git a/src/admin/paths/admin@advances@stats.yaml b/src/admin/paths/admin@advances@stats.yaml index 54003447c..2e99a08d2 100644 --- a/src/admin/paths/admin@advances@stats.yaml +++ b/src/admin/paths/admin@advances@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance.yaml#/advances_stats_out' diff --git a/src/admin/paths/admin@automations@report_submissions.yaml b/src/admin/paths/admin@automations@report_submissions.yaml index ea115d3bf..20d28a5d3 100644 --- a/src/admin/paths/admin@automations@report_submissions.yaml +++ b/src/admin/paths/admin@automations@report_submissions.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/automation.yaml#/automate_report_submission_out @@ -67,6 +69,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@automations@report_submissions@delete.yaml b/src/admin/paths/admin@automations@report_submissions@delete.yaml index 6f363fe20..6e4787d82 100644 --- a/src/admin/paths/admin@automations@report_submissions@delete.yaml +++ b/src/admin/paths/admin@automations@report_submissions@delete.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/automation.yaml#/automate_report_submission_out diff --git a/src/admin/paths/admin@budget_usages.yaml b/src/admin/paths/admin@budget_usages.yaml index d05a13c0b..88e3c4117 100644 --- a/src/admin/paths/admin@budget_usages.yaml +++ b/src/admin/paths/admin@budget_usages.yaml @@ -16,6 +16,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@budgets.yaml b/src/admin/paths/admin@budgets.yaml index 901f56121..25c99f06b 100644 --- a/src/admin/paths/admin@budgets.yaml +++ b/src/admin/paths/admin@budgets.yaml @@ -25,9 +25,11 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: - $ref: ../../components/schemas/budget.yaml#/budget_out + $ref: ../../components/schemas/budget.yaml#/budget_post_out '400': description: Bad request content: @@ -68,6 +70,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@budgets@exports.yaml b/src/admin/paths/admin@budgets@exports.yaml new file mode 100644 index 000000000..771917194 --- /dev/null +++ b/src/admin/paths/admin@budgets@exports.yaml @@ -0,0 +1,51 @@ +post: + tags: + - Budgets + summary: Create Budget Export + description: | + Create a Budget Export Request. This exports budget data with the following columns: + Budget Name, Budget Frequency, Budget Amount, Utilisation (%, Amount), Remaining, Status, Created By, Start Date. + The export is generated in xlsx format. + operationId: budgets_exports_post + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '../../components/schemas/budget_exports.yaml#/budget_exports_in' + required: + - data + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '../../components/schemas/budget_exports.yaml#/budget_exports_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + diff --git a/src/admin/paths/admin@categories.yaml b/src/admin/paths/admin@categories.yaml index 95fb67969..b83f6e782 100644 --- a/src/admin/paths/admin@categories.yaml +++ b/src/admin/paths/admin@categories.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -61,6 +65,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/category.yaml#/admin_approver_category_out diff --git a/src/admin/paths/admin@categories@system_categories.yaml b/src/admin/paths/admin@categories@system_categories.yaml index 62ece4d35..701ced45b 100644 --- a/src/admin/paths/admin@categories@system_categories.yaml +++ b/src/admin/paths/admin@categories@system_categories.yaml @@ -13,6 +13,9 @@ get: schema: type: object additionalProperties: False + required: + - data + - count properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@corporate_card_transactions.yaml b/src/admin/paths/admin@corporate_card_transactions.yaml index 92c26a9c5..3c075f769 100644 --- a/src/admin/paths/admin@corporate_card_transactions.yaml +++ b/src/admin/paths/admin@corporate_card_transactions.yaml @@ -19,6 +19,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -65,6 +69,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_post_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@assign.yaml b/src/admin/paths/admin@corporate_card_transactions@assign.yaml index a4c225645..164cf9037 100644 --- a/src/admin/paths/admin@corporate_card_transactions@assign.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@assign.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_assign_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@delete.yaml b/src/admin/paths/admin@corporate_card_transactions@delete.yaml index 61b423a22..07939d246 100644 --- a/src/admin/paths/admin@corporate_card_transactions@delete.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@delete.yaml @@ -26,6 +26,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/admin/paths/admin@corporate_card_transactions@delete_summary@bulk.yaml b/src/admin/paths/admin@corporate_card_transactions@delete_summary@bulk.yaml index 8f4c16436..7bfa398ce 100644 --- a/src/admin/paths/admin@corporate_card_transactions@delete_summary@bulk.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@delete_summary@bulk.yaml @@ -26,6 +26,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/admin/paths/admin@corporate_card_transactions@export_configurations.yaml b/src/admin/paths/admin@corporate_card_transactions@export_configurations.yaml index 1c36bdcdf..7213a20b8 100644 --- a/src/admin/paths/admin@corporate_card_transactions@export_configurations.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@export_configurations.yaml @@ -17,6 +17,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -157,6 +161,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transactions_export_configurations.yaml#/corporate_card_transactions_export_configuration_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@exports.yaml b/src/admin/paths/admin@corporate_card_transactions@exports.yaml index a0600ae9b..1adce438e 100644 --- a/src/admin/paths/admin@corporate_card_transactions@exports.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@exports.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transactions_exports.yaml#/corporate_card_transactions_exports_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@filters.yaml b/src/admin/paths/admin@corporate_card_transactions@filters.yaml index 5713f12d8..8034539b3 100644 --- a/src/admin/paths/admin@corporate_card_transactions@filters.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@filters.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction_filters.yaml#/corporate_card_transaction_filters_out' @@ -59,6 +61,8 @@ get: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@corporate_card_transactions@filters@delete.yaml b/src/admin/paths/admin@corporate_card_transactions@filters@delete.yaml index b3e617efb..2666a271b 100644 --- a/src/admin/paths/admin@corporate_card_transactions@filters@delete.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@filters@delete.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction_filters.yaml#/corporate_card_transaction_filters_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@ignore.yaml b/src/admin/paths/admin@corporate_card_transactions@ignore.yaml index af8d658dd..2a34f0ea2 100644 --- a/src/admin/paths/admin@corporate_card_transactions@ignore.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@ignore.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_ignore_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@mark_personal.yaml b/src/admin/paths/admin@corporate_card_transactions@mark_personal.yaml index 8105cd9de..a689b154c 100644 --- a/src/admin/paths/admin@corporate_card_transactions@mark_personal.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@mark_personal.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_mark_personal_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@match.yaml b/src/admin/paths/admin@corporate_card_transactions@match.yaml index 4c60ece64..7cbe00818 100644 --- a/src/admin/paths/admin@corporate_card_transactions@match.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@match.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_match_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@stats.yaml b/src/admin/paths/admin@corporate_card_transactions@stats.yaml index fc87585f1..3c19e125e 100644 --- a/src/admin/paths/admin@corporate_card_transactions@stats.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@stats.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/admin/paths/admin@corporate_card_transactions@unassign.yaml b/src/admin/paths/admin@corporate_card_transactions@unassign.yaml index 3bab0bb07..bc01a9857 100644 --- a/src/admin/paths/admin@corporate_card_transactions@unassign.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@unassign.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_unassign_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@undo_ignore.yaml b/src/admin/paths/admin@corporate_card_transactions@undo_ignore.yaml index fec689502..5f28cd2e5 100644 --- a/src/admin/paths/admin@corporate_card_transactions@undo_ignore.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@undo_ignore.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_undo_ignore_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@unmark_personal.yaml b/src/admin/paths/admin@corporate_card_transactions@unmark_personal.yaml index b68b9b0a8..91bebf4fe 100644 --- a/src/admin/paths/admin@corporate_card_transactions@unmark_personal.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@unmark_personal.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_unmark_personal_out' diff --git a/src/admin/paths/admin@corporate_card_transactions@unmatch.yaml b/src/admin/paths/admin@corporate_card_transactions@unmatch.yaml index a5f3244d4..7677284cd 100644 --- a/src/admin/paths/admin@corporate_card_transactions@unmatch.yaml +++ b/src/admin/paths/admin@corporate_card_transactions@unmatch.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_unmatch_out' diff --git a/src/admin/paths/admin@corporate_cards.yaml b/src/admin/paths/admin@corporate_cards.yaml index 7eedd9054..7544044b4 100644 --- a/src/admin/paths/admin@corporate_cards.yaml +++ b/src/admin/paths/admin@corporate_cards.yaml @@ -19,6 +19,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -65,6 +69,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_out' diff --git a/src/admin/paths/admin@corporate_cards@archive.yaml b/src/admin/paths/admin@corporate_cards@archive.yaml new file mode 100644 index 000000000..63b51ae9f --- /dev/null +++ b/src/admin/paths/admin@corporate_cards@archive.yaml @@ -0,0 +1,56 @@ +post: + tags: + - Corporate Cards + summary: Archive a corporate card + description: | + Archive a corporate card + operationId: corporate_cards_archive + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../components/schemas/corporate_card.yaml#/corporate_card_archive_in + required: + - data + additionalProperties: False + + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@corporate_cards@archive_suggestions.yaml b/src/admin/paths/admin@corporate_cards@archive_suggestions.yaml new file mode 100644 index 000000000..d5d066ab3 --- /dev/null +++ b/src/admin/paths/admin@corporate_cards@archive_suggestions.yaml @@ -0,0 +1,46 @@ +get: + tags: + - Corporate Cards + summary: List corporate card archive suggestions + description: | + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: corporate_card_archive_suggestions_list + parameters: + - $ref: '../../components/parameters/q.yaml' + - $ref: '../../components/parameters/created_at.yaml' + - $ref: '../../components/parameters/updated_at.yaml' + - $ref: '../../components/parameters/order.yaml' + - $ref: '../../components/parameters/offset.yaml' + - $ref: '../../components/parameters/limit.yaml' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + $ref: '../../components/schemas/count.yaml' + offset: + $ref: '../../components/schemas/offset.yaml' + data: + type: array + items: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_archive_suggestion_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' diff --git a/src/admin/paths/admin@corporate_cards@archive_suggestions@dismiss.yaml b/src/admin/paths/admin@corporate_cards@archive_suggestions@dismiss.yaml new file mode 100644 index 000000000..67621dd1d --- /dev/null +++ b/src/admin/paths/admin@corporate_cards@archive_suggestions@dismiss.yaml @@ -0,0 +1,55 @@ +post: + tags: + - Corporate Cards + summary: Dismiss a corporate card archive suggestion + description: | + Dismiss a corporate card archive suggestion + operationId: corporate_cards_archive_suggestion_dismiss + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../components/schemas/corporate_card.yaml#/corporate_card_archive_suggestion_dismiss_in + required: + - data + additionalProperties: False + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_archive_suggestion_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@corporate_cards@assign.yaml b/src/admin/paths/admin@corporate_cards@assign.yaml index ff739e803..36a0d7256 100644 --- a/src/admin/paths/admin@corporate_cards@assign.yaml +++ b/src/admin/paths/admin@corporate_cards@assign.yaml @@ -25,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_out' diff --git a/src/admin/paths/admin@corporate_cards@bank_names.yaml b/src/admin/paths/admin@corporate_cards@bank_names.yaml index 1e5cdee35..feed534db 100644 --- a/src/admin/paths/admin@corporate_cards@bank_names.yaml +++ b/src/admin/paths/admin@corporate_cards@bank_names.yaml @@ -12,9 +12,13 @@ get: application/json: schema: type: object + required: + - data properties: data: type: object + required: + - bank_names properties: bank_names: type: array diff --git a/src/admin/paths/admin@corporate_cards@delete.yaml b/src/admin/paths/admin@corporate_cards@delete.yaml index aad46e8e8..e562ea251 100644 --- a/src/admin/paths/admin@corporate_cards@delete.yaml +++ b/src/admin/paths/admin@corporate_cards@delete.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_out' diff --git a/src/admin/paths/admin@corporate_cards@duplicate_suggestions.yaml b/src/admin/paths/admin@corporate_cards@duplicate_suggestions.yaml new file mode 100644 index 000000000..fd62fb173 --- /dev/null +++ b/src/admin/paths/admin@corporate_cards@duplicate_suggestions.yaml @@ -0,0 +1,46 @@ +get: + tags: + - Corporate Cards + summary: List corporate card duplicate suggestions + description: | + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: corporate_card_duplicate_suggestions_list + parameters: + - $ref: '../../components/parameters/q.yaml' + - $ref: '../../components/parameters/created_at.yaml' + - $ref: '../../components/parameters/updated_at.yaml' + - $ref: '../../components/parameters/order.yaml' + - $ref: '../../components/parameters/offset.yaml' + - $ref: '../../components/parameters/limit.yaml' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + $ref: '../../components/schemas/count.yaml' + offset: + $ref: '../../components/schemas/offset.yaml' + data: + type: array + items: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_duplicate_suggestion_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: ../../components/schemas/400.yaml + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' diff --git a/src/admin/paths/admin@corporate_cards@duplicate_suggestions@dismiss.yaml b/src/admin/paths/admin@corporate_cards@duplicate_suggestions@dismiss.yaml new file mode 100644 index 000000000..e53b58c97 --- /dev/null +++ b/src/admin/paths/admin@corporate_cards@duplicate_suggestions@dismiss.yaml @@ -0,0 +1,55 @@ +post: + tags: + - Corporate Cards + summary: Dismiss a corporate card duplicate suggestion + description: | + Dismiss a corporate card duplicate suggestion + operationId: corporate_cards_dismiss_duplicate_suggestion + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../components/schemas/corporate_card.yaml#/corporate_card_duplicate_suggestion_dismiss_in + required: + - data + additionalProperties: False + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_duplicate_suggestion_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@corporate_cards@masked_card_numbers.yaml b/src/admin/paths/admin@corporate_cards@masked_card_numbers.yaml index 1327e4875..fb65a6908 100644 --- a/src/admin/paths/admin@corporate_cards@masked_card_numbers.yaml +++ b/src/admin/paths/admin@corporate_cards@masked_card_numbers.yaml @@ -15,6 +15,8 @@ get: application/json: schema: type: object + required: + - data properties: data: type: object diff --git a/src/admin/paths/admin@corporate_cards@merge.yaml b/src/admin/paths/admin@corporate_cards@merge.yaml new file mode 100644 index 000000000..452aeeeb0 --- /dev/null +++ b/src/admin/paths/admin@corporate_cards@merge.yaml @@ -0,0 +1,56 @@ +post: + tags: + - Corporate Cards + summary: Merge Duplicate Corporate Cards + description: | + Merges a source card into a destination card by consolidating all associated data into the destination and removing the source card. + operationId: corporate_cards_merge + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../components/schemas/corporate_card.yaml#/corporate_card_merge_in + required: + - data + additionalProperties: False + + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@corporate_cards@reassign.yaml b/src/admin/paths/admin@corporate_cards@reassign.yaml index 6c609bdc1..bd454839e 100644 --- a/src/admin/paths/admin@corporate_cards@reassign.yaml +++ b/src/admin/paths/admin@corporate_cards@reassign.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_out' diff --git a/src/admin/paths/admin@corporate_cards@stats.yaml b/src/admin/paths/admin@corporate_cards@stats.yaml index f994b78a8..bfec761b7 100644 --- a/src/admin/paths/admin@corporate_cards@stats.yaml +++ b/src/admin/paths/admin@corporate_cards@stats.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_stats_out' diff --git a/src/admin/paths/admin@corporate_cards@unarchive.yaml b/src/admin/paths/admin@corporate_cards@unarchive.yaml new file mode 100644 index 000000000..ad5809880 --- /dev/null +++ b/src/admin/paths/admin@corporate_cards@unarchive.yaml @@ -0,0 +1,56 @@ +post: + tags: + - Corporate Cards + summary: Unarchive a corporate card + description: | + Unarchive a corporate card + operationId: corporate_cards_unarchive + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../components/schemas/corporate_card.yaml#/corporate_card_unarchive_in + required: + - data + additionalProperties: False + + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@corporate_cards@unarchive@bulk.yaml b/src/admin/paths/admin@corporate_cards@unarchive@bulk.yaml new file mode 100644 index 000000000..9e95f516e --- /dev/null +++ b/src/admin/paths/admin@corporate_cards@unarchive@bulk.yaml @@ -0,0 +1,64 @@ +post: + tags: + - Corporate Cards + summary: Bulk unarchive corporate cards + description: | + Unarchive corporate cards in bulk. + operationId: corporate_cards_unarchive_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_unarchive_in' + required: + - data + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: ../../components/schemas/bulk_error.yaml + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/admin/paths/admin@corporate_cards@unassign.yaml b/src/admin/paths/admin@corporate_cards@unassign.yaml index 24bba1d9d..8798ff037 100644 --- a/src/admin/paths/admin@corporate_cards@unassign.yaml +++ b/src/admin/paths/admin@corporate_cards@unassign.yaml @@ -25,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_unassign_out' diff --git a/src/admin/paths/admin@cost_centers.yaml b/src/admin/paths/admin@cost_centers.yaml index c0904af3a..18b840621 100644 --- a/src/admin/paths/admin@cost_centers.yaml +++ b/src/admin/paths/admin@cost_centers.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -67,6 +71,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/cost_center.yaml#/admin_cost_center_out diff --git a/src/admin/paths/admin@cost_centers@delete@bulk.yaml b/src/admin/paths/admin@cost_centers@delete@bulk.yaml new file mode 100644 index 000000000..e0183b7fc --- /dev/null +++ b/src/admin/paths/admin@cost_centers@delete@bulk.yaml @@ -0,0 +1,58 @@ +post: + tags: + - Cost Centers + summary: Deletes cost centers + description: | + Deletes unused cost centers. If any of the cost center in input is used in other resources then validation error is raised. + operationId: cost_centers_delete_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/cost_center.yaml#/cost_center_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: "../../components/schemas/401.yaml" + '403': + description: Forbidden + content: + application/json: + schema: + $ref: "../../components/schemas/403.yaml" + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + nullable: true + example: | + Can not delete cost center(s) used in other resources like expense, expense policy, expense rules, budgets, dependent fields. + data: + type: object + example: null + error: + type: string + example: InvalidUsage diff --git a/src/admin/paths/admin@cost_centers@delete_summary@bulk.yaml b/src/admin/paths/admin@cost_centers@delete_summary@bulk.yaml new file mode 100644 index 000000000..873c93adb --- /dev/null +++ b/src/admin/paths/admin@cost_centers@delete_summary@bulk.yaml @@ -0,0 +1,41 @@ +post: + tags: + - Cost Centers + summary: Create delete summary for cost centers + description: | + Delete summary tells that how many cost centers could be deleted from given cost centers, it also + returns cost centers that could be deleted. + operationId: cost_centers_delete_summary_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/cost_center.yaml#/cost_center_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '../../components/schemas/cost_center.yaml#/cost_center_delete_summary_out' + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: "../../components/schemas/401.yaml" + '403': + description: Forbidden + content: + application/json: + schema: + $ref: "../../components/schemas/403.yaml" diff --git a/src/admin/paths/admin@departments.yaml b/src/admin/paths/admin@departments.yaml index 6f2ff0e61..39511bd9b 100644 --- a/src/admin/paths/admin@departments.yaml +++ b/src/admin/paths/admin@departments.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -61,6 +65,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/department.yaml#/department_out diff --git a/src/admin/paths/admin@departments@delete@bulk.yaml b/src/admin/paths/admin@departments@delete@bulk.yaml new file mode 100644 index 000000000..302a642d2 --- /dev/null +++ b/src/admin/paths/admin@departments@delete@bulk.yaml @@ -0,0 +1,75 @@ +post: + tags: + - Departments + security: + - oauth2: ['*'] + summary: Delete departments + description: | + Deletes unused departments. If any supplied department is assigned to an employee or used + by a budget, expense policy, or expense rule, the request fails without deleting any + departments. A maximum of 200 unique department IDs can be processed. Repeated IDs are + deduplicated in first-seen order before the limit is enforced. + operationId: departments_delete_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/department.yaml#/department_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + examples: + limit_exceeded: + summary: More than 200 unique department IDs supplied + value: + message: Cannot perform action for more than 200 departments at once. + data: null + error: InvalidUsage + dependency_blocked: + summary: A department is assigned or used by another resource + value: + message: Can not delete department(s) used in other resources like employee assignments, budgets, expense policy, expense rules. + data: null + error: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/admin/paths/admin@departments@delete_summary@bulk.yaml b/src/admin/paths/admin@departments@delete_summary@bulk.yaml new file mode 100644 index 000000000..f8b63e153 --- /dev/null +++ b/src/admin/paths/admin@departments@delete_summary@bulk.yaml @@ -0,0 +1,62 @@ +post: + tags: + - Departments + security: + - oauth2: ['*'] + summary: Create delete summary for departments + description: | + Returns how many of the supplied departments can be deleted and lists those departments. + Departments assigned to employees or used by budgets, expense policies, or expense rules + are excluded. A maximum of 200 unique department IDs can be processed. Repeated IDs are + deduplicated in first-seen order before the limit is enforced. + operationId: departments_delete_summary_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/department.yaml#/department_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '../../components/schemas/department.yaml#/department_delete_summary_out' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Cannot perform action for more than 200 departments at once. + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/admin/paths/admin@dependent_expense_field_values.yaml b/src/admin/paths/admin@dependent_expense_field_values.yaml index 595f62692..ecdc2f576 100644 --- a/src/admin/paths/admin@dependent_expense_field_values.yaml +++ b/src/admin/paths/admin@dependent_expense_field_values.yaml @@ -51,6 +51,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@dependent_expense_field_values@downloads.yaml b/src/admin/paths/admin@dependent_expense_field_values@downloads.yaml index 6af330bd5..d3875747b 100644 --- a/src/admin/paths/admin@dependent_expense_field_values@downloads.yaml +++ b/src/admin/paths/admin@dependent_expense_field_values@downloads.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -59,6 +63,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/dependent_expense_field_values.yaml#/dependent_expense_field_values_download_out' diff --git a/src/admin/paths/admin@dependent_expense_field_values@preview.yaml b/src/admin/paths/admin@dependent_expense_field_values@preview.yaml index 51b10c70f..061b24c5b 100644 --- a/src/admin/paths/admin@dependent_expense_field_values@preview.yaml +++ b/src/admin/paths/admin@dependent_expense_field_values@preview.yaml @@ -41,6 +41,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@dependent_expense_field_values@uploads.yaml b/src/admin/paths/admin@dependent_expense_field_values@uploads.yaml index e002a5402..ea2bc809e 100644 --- a/src/admin/paths/admin@dependent_expense_field_values@uploads.yaml +++ b/src/admin/paths/admin@dependent_expense_field_values@uploads.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -59,6 +63,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/dependent_expense_field_values.yaml#/dependent_expense_field_values_upload_out' diff --git a/src/admin/paths/admin@dwolla_customers.yaml b/src/admin/paths/admin@dwolla_customers.yaml index 7f3a9a0cc..a944eb6bb 100644 --- a/src/admin/paths/admin@dwolla_customers.yaml +++ b/src/admin/paths/admin@dwolla_customers.yaml @@ -13,6 +13,8 @@ get: schema: type: object additionalProperties: False + required: + - data properties: data: allOf: @@ -58,6 +60,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/dwolla_customer.yaml#/dwolla_customer_out' diff --git a/src/admin/paths/admin@employee_account_summaries.yaml b/src/admin/paths/admin@employee_account_summaries.yaml index 537ef8bf5..c7a175bf6 100644 --- a/src/admin/paths/admin@employee_account_summaries.yaml +++ b/src/admin/paths/admin@employee_account_summaries.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@employee_fields.yaml b/src/admin/paths/admin@employee_fields.yaml index 35c488c69..fa8537f02 100644 --- a/src/admin/paths/admin@employee_fields.yaml +++ b/src/admin/paths/admin@employee_fields.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -56,6 +60,8 @@ post: application/json: schema: type: object + required: + - data properties: url: type: string diff --git a/src/admin/paths/admin@employees.yaml b/src/admin/paths/admin@employees.yaml index 4ec6009cd..797f8a398 100644 --- a/src/admin/paths/admin@employees.yaml +++ b/src/admin/paths/admin@employees.yaml @@ -15,6 +15,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@employees@business_units.yaml b/src/admin/paths/admin@employees@business_units.yaml index a90a3915a..217f567b6 100644 --- a/src/admin/paths/admin@employees@business_units.yaml +++ b/src/admin/paths/admin@employees@business_units.yaml @@ -15,9 +15,13 @@ get: application/json: schema: type: object + required: + - data properties: data: type: object + required: + - business_units properties: business_units: type: array diff --git a/src/admin/paths/admin@employees@downloads.yaml b/src/admin/paths/admin@employees@downloads.yaml index afba07f60..a6522340a 100644 --- a/src/admin/paths/admin@employees@downloads.yaml +++ b/src/admin/paths/admin@employees@downloads.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -61,6 +65,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/employee.yaml#/employees_download_out' diff --git a/src/admin/paths/admin@employees@export_configurations.yaml b/src/admin/paths/admin@employees@export_configurations.yaml index 534886b25..1ebea4124 100644 --- a/src/admin/paths/admin@employees@export_configurations.yaml +++ b/src/admin/paths/admin@employees@export_configurations.yaml @@ -19,6 +19,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -159,6 +163,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/employees_export_configurations.yaml#/employees_export_configuration_out' diff --git a/src/admin/paths/admin@employees@exports.yaml b/src/admin/paths/admin@employees@exports.yaml index e9e34ca4e..142c571e6 100644 --- a/src/admin/paths/admin@employees@exports.yaml +++ b/src/admin/paths/admin@employees@exports.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/employees_exports.yaml#/employees_exports_out' diff --git a/src/admin/paths/admin@employees@filters.yaml b/src/admin/paths/admin@employees@filters.yaml index a2961257a..f5832b22a 100644 --- a/src/admin/paths/admin@employees@filters.yaml +++ b/src/admin/paths/admin@employees@filters.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/employee_filters.yaml#/employee_filters_out' @@ -59,6 +61,8 @@ get: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@employees@filters@delete.yaml b/src/admin/paths/admin@employees@filters@delete.yaml index 9a485e223..4c3ec7877 100644 --- a/src/admin/paths/admin@employees@filters@delete.yaml +++ b/src/admin/paths/admin@employees@filters@delete.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/employee_filters.yaml#/employee_filters_out' diff --git a/src/admin/paths/admin@employees@locations.yaml b/src/admin/paths/admin@employees@locations.yaml index 87681eb4b..0651b1adc 100644 --- a/src/admin/paths/admin@employees@locations.yaml +++ b/src/admin/paths/admin@employees@locations.yaml @@ -15,9 +15,13 @@ get: application/json: schema: type: object + required: + - data properties: data: type: object + required: + - locations properties: locations: type: array diff --git a/src/admin/paths/admin@employees@potential_duplicate_expenses.yaml b/src/admin/paths/admin@employees@potential_duplicate_expenses.yaml index 53c586a15..1f1ba8186 100644 --- a/src/admin/paths/admin@employees@potential_duplicate_expenses.yaml +++ b/src/admin/paths/admin@employees@potential_duplicate_expenses.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@employees@stats.yaml b/src/admin/paths/admin@employees@stats.yaml index bebfd19ae..aab808494 100644 --- a/src/admin/paths/admin@employees@stats.yaml +++ b/src/admin/paths/admin@employees@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/employee.yaml#/employees_stats_out' diff --git a/src/admin/paths/admin@employees@summaries.yaml b/src/admin/paths/admin@employees@summaries.yaml index ce10ec868..d7937aafc 100644 --- a/src/admin/paths/admin@employees@summaries.yaml +++ b/src/admin/paths/admin@employees@summaries.yaml @@ -15,6 +15,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@employees@titles.yaml b/src/admin/paths/admin@employees@titles.yaml index ad7022c51..a611bc875 100644 --- a/src/admin/paths/admin@employees@titles.yaml +++ b/src/admin/paths/admin@employees@titles.yaml @@ -15,9 +15,13 @@ get: application/json: schema: type: object + required: + - data properties: data: type: object + required: + - titles properties: titles: type: array diff --git a/src/admin/paths/admin@employees@uploads.yaml b/src/admin/paths/admin@employees@uploads.yaml index c54a71aef..289929f91 100644 --- a/src/admin/paths/admin@employees@uploads.yaml +++ b/src/admin/paths/admin@employees@uploads.yaml @@ -13,6 +13,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -61,6 +65,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/employee.yaml#/employees_upload_out' diff --git a/src/admin/paths/admin@expense_fields.yaml b/src/admin/paths/admin@expense_fields.yaml index 5a5cecf4c..2efd1d8f6 100644 --- a/src/admin/paths/admin@expense_fields.yaml +++ b/src/admin/paths/admin@expense_fields.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -56,6 +60,8 @@ post: application/json: schema: type: object + required: + - data properties: url: type: string diff --git a/src/admin/paths/admin@expense_fields@reorder.yaml b/src/admin/paths/admin@expense_fields@reorder.yaml new file mode 100644 index 000000000..cfbebc86c --- /dev/null +++ b/src/admin/paths/admin@expense_fields@reorder.yaml @@ -0,0 +1,62 @@ +post: + tags: + - Expenses + summary: Reorder custom expense fields + description: | + Reorders all enabled, non-dependent custom expense fields for the + organization. Every eligible expense field must be included exactly once. + The order of the request items determines the `display_order`, starting from 1. + operationId: expense_fields_reorder + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: The complete ordered list of eligible expense field IDs. + minItems: 1 + uniqueItems: true + items: + $ref: '../../components/schemas/expense_field.yaml#/expense_field_reorder_in' + responses: + '200': + description: Expense fields reordered successfully. + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: The reordered expense fields. + items: + $ref: '../../components/schemas/expense_field.yaml#/expense_field_out' + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: ../../components/schemas/bulk_error.yaml + - $ref: ../../components/schemas/400.yaml + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: ../../components/schemas/401.yaml + '403': + description: Forbidden + content: + application/json: + schema: + $ref: ../../components/schemas/403.yaml diff --git a/src/admin/paths/admin@expense_policies.yaml b/src/admin/paths/admin@expense_policies.yaml index 47fb80f4e..3a0dc57b5 100644 --- a/src/admin/paths/admin@expense_policies.yaml +++ b/src/admin/paths/admin@expense_policies.yaml @@ -31,6 +31,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/expense_policies.yaml#/expense_policy_out @@ -113,6 +115,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@expense_policies@disable.yaml b/src/admin/paths/admin@expense_policies@disable.yaml index 9e804fcb6..80784a21d 100644 --- a/src/admin/paths/admin@expense_policies@disable.yaml +++ b/src/admin/paths/admin@expense_policies@disable.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/expense_policies.yaml#/expense_policy_out diff --git a/src/admin/paths/admin@expense_policies@enable.yaml b/src/admin/paths/admin@expense_policies@enable.yaml index d2268e290..d23e1c5c8 100644 --- a/src/admin/paths/admin@expense_policies@enable.yaml +++ b/src/admin/paths/admin@expense_policies@enable.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/expense_policies.yaml#/expense_policy_out diff --git a/src/admin/paths/admin@expense_policies@states.yaml b/src/admin/paths/admin@expense_policies@states.yaml index 9316b6a4e..2bd6f130f 100644 --- a/src/admin/paths/admin@expense_policies@states.yaml +++ b/src/admin/paths/admin@expense_policies@states.yaml @@ -29,6 +29,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@expense_policy_comments.yaml b/src/admin/paths/admin@expense_policy_comments.yaml index 527955494..5c3668172 100644 --- a/src/admin/paths/admin@expense_policy_comments.yaml +++ b/src/admin/paths/admin@expense_policy_comments.yaml @@ -26,6 +26,9 @@ post: type: array items: type: object + required: + - comment_type + - comment_text properties: comment_type: type: string @@ -55,6 +58,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: object diff --git a/src/admin/paths/admin@expense_rules.yaml b/src/admin/paths/admin@expense_rules.yaml index 7b57056ea..b18e7098f 100644 --- a/src/admin/paths/admin@expense_rules.yaml +++ b/src/admin/paths/admin@expense_rules.yaml @@ -63,6 +63,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@expenses.yaml b/src/admin/paths/admin@expenses.yaml index b07ec19f7..5c9213e25 100644 --- a/src/admin/paths/admin@expenses.yaml +++ b/src/admin/paths/admin@expenses.yaml @@ -14,6 +14,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -48,6 +52,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/admin_expense_in' @@ -58,6 +64,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_out' diff --git a/src/admin/paths/admin@expenses@attach_files@bulk.yaml b/src/admin/paths/admin@expenses@attach_files@bulk.yaml index 697d8e58d..10a43e46a 100644 --- a/src/admin/paths/admin@expenses@attach_files@bulk.yaml +++ b/src/admin/paths/admin@expenses@attach_files@bulk.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@expenses@bulk.yaml b/src/admin/paths/admin@expenses@bulk.yaml new file mode 100644 index 000000000..07ec4dae0 --- /dev/null +++ b/src/admin/paths/admin@expenses@bulk.yaml @@ -0,0 +1,56 @@ +post: + tags: + - Expenses + summary: Update expenses in bulk + description: | + Update expenses in bulk by admin. + operationId: admin_expenses_post_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '../../components/schemas/expense.yaml#/admin_expenses_bulk_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/expense.yaml#/expense_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' \ No newline at end of file diff --git a/src/admin/paths/admin@expenses@check_mandatory_fields_bulk.yaml b/src/admin/paths/admin@expenses@check_mandatory_fields_bulk.yaml new file mode 100644 index 000000000..262c86847 --- /dev/null +++ b/src/admin/paths/admin@expenses@check_mandatory_fields_bulk.yaml @@ -0,0 +1,57 @@ +post: + tags: + - Expenses + summary: Check multiple expenses for missing mandatory fields in bulk + description: | + Before updating multiple expense objects as an admin, you can validate + if all mandatory fields are present using this bulk endpoint. + operationId: admin_check_mandatory_fields_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: '../../components/schemas/expense.yaml#/admin_expense_check_mandatory_fields_bulk_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: ../../components/schemas/expense.yaml#/expense_check_mandatory_fields_bulk_out + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' \ No newline at end of file diff --git a/src/admin/paths/admin@expenses@check_policies_bulk.yaml b/src/admin/paths/admin@expenses@check_policies_bulk.yaml new file mode 100644 index 000000000..5a4e15542 --- /dev/null +++ b/src/admin/paths/admin@expenses@check_policies_bulk.yaml @@ -0,0 +1,53 @@ +post: + tags: + - Expenses + summary: Check multiple expenses for policy violations in bulk + description: | + Admin bulk version of the check_policies API that allows checking + multiple expenses for policy violations in one request. + + **NOTE:** This API can only be used to check policies for existing expenses that you want to update. The API will evaluate all the expenses against the configured policy rules and return an array of policy violation information for each expense in the request payload. + operationId: admin_check_policies_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: "../../components/schemas/expense.yaml#/admin_check_policies_bulk_in" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: ../../components/schemas/expense.yaml#/expense_check_policies_bulk_out + "401": + description: Unauthorised request + content: + application/json: + schema: + $ref: "../../components/schemas/401.yaml" + "400": + description: Bad request + content: + application/json: + schema: + $ref: "../../components/schemas/400.yaml" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "../../components/schemas/404.yaml" \ No newline at end of file diff --git a/src/admin/paths/admin@expenses@comments.yaml b/src/admin/paths/admin@expenses@comments.yaml index 3231c3d8a..ff96ac90f 100644 --- a/src/admin/paths/admin@expenses@comments.yaml +++ b/src/admin/paths/admin@expenses@comments.yaml @@ -13,6 +13,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@expenses@comments@bulk.yaml b/src/admin/paths/admin@expenses@comments@bulk.yaml index a48fa6c05..4d597c219 100644 --- a/src/admin/paths/admin@expenses@comments@bulk.yaml +++ b/src/admin/paths/admin@expenses@comments@bulk.yaml @@ -13,6 +13,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_comments_bulk_in' @@ -23,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@expenses@count.yaml b/src/admin/paths/admin@expenses@count.yaml new file mode 100644 index 000000000..205fcaa86 --- /dev/null +++ b/src/admin/paths/admin@expenses@count.yaml @@ -0,0 +1,66 @@ +get: + tags: + - Expenses + summary: Get expense count + description: | + Returns the number of expenses in the requested state that belong to enabled employees in the organization. + operationId: expenses_count + parameters: + - in: query + name: state + required: true + description: | + Valid expense state for which the count should be returned.
+ Supported operators are `eq`.
+ state=eq.DRAFT + schema: + type: string + example: eq.DRAFT + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: '../../components/schemas/expense.yaml#/expenses_count_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + - error + - message + properties: + data: + type: object + nullable: true + example: null + error: + type: string + enum: + - InvalidUsage + message: + type: string + example: You don't have permissions to access this resource diff --git a/src/admin/paths/admin@expenses@duplicate_sets.yaml b/src/admin/paths/admin@expenses@duplicate_sets.yaml index f8f622c84..417a4ac2d 100644 --- a/src/admin/paths/admin@expenses@duplicate_sets.yaml +++ b/src/admin/paths/admin@expenses@duplicate_sets.yaml @@ -21,6 +21,8 @@ get: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@expenses@duplicate_sets@stats.yaml b/src/admin/paths/admin@expenses@duplicate_sets@stats.yaml index 2a9579818..89bdddbb5 100644 --- a/src/admin/paths/admin@expenses@duplicate_sets@stats.yaml +++ b/src/admin/paths/admin@expenses@duplicate_sets@stats.yaml @@ -26,6 +26,8 @@ get: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense_duplicate_set.yaml#/expenses_duplicate_sets_stats_out' diff --git a/src/admin/paths/admin@expenses@export_configurations.yaml b/src/admin/paths/admin@expenses@export_configurations.yaml index ed920ec01..837605ec1 100644 --- a/src/admin/paths/admin@expenses@export_configurations.yaml +++ b/src/admin/paths/admin@expenses@export_configurations.yaml @@ -17,6 +17,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -143,6 +147,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expenses_export_configurations.yaml#/expenses_export_configuration_out' diff --git a/src/admin/paths/admin@expenses@exports.yaml b/src/admin/paths/admin@expenses@exports.yaml index 0736bd382..1e0d8906e 100644 --- a/src/admin/paths/admin@expenses@exports.yaml +++ b/src/admin/paths/admin@expenses@exports.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expenses_exports.yaml#/expenses_exports_out' diff --git a/src/admin/paths/admin@expenses@filters.yaml b/src/admin/paths/admin@expenses@filters.yaml index 4320f56e9..10e5f6f1c 100644 --- a/src/admin/paths/admin@expenses@filters.yaml +++ b/src/admin/paths/admin@expenses@filters.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense_filters.yaml#/expense_filters_out' @@ -59,6 +61,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@expenses@filters@delete.yaml b/src/admin/paths/admin@expenses@filters@delete.yaml index 144f8b063..0acdb816f 100644 --- a/src/admin/paths/admin@expenses@filters@delete.yaml +++ b/src/admin/paths/admin@expenses@filters@delete.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense_filters.yaml#/expense_filters_out' diff --git a/src/admin/paths/admin@expenses@merge.yaml b/src/admin/paths/admin@expenses@merge.yaml index 9684a9e75..1f7c77091 100644 --- a/src/admin/paths/admin@expenses@merge.yaml +++ b/src/admin/paths/admin@expenses@merge.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expenses_merge_in' @@ -21,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_out' diff --git a/src/admin/paths/admin@expenses@permissions.yaml b/src/admin/paths/admin@expenses@permissions.yaml index d6001df6f..3364da543 100644 --- a/src/admin/paths/admin@expenses@permissions.yaml +++ b/src/admin/paths/admin@expenses@permissions.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_permissions_out' diff --git a/src/admin/paths/admin@expenses@permissions@bulk.yaml b/src/admin/paths/admin@expenses@permissions@bulk.yaml index 0c0719457..8664840e7 100644 --- a/src/admin/paths/admin@expenses@permissions@bulk.yaml +++ b/src/admin/paths/admin@expenses@permissions@bulk.yaml @@ -33,6 +33,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_permissions_bulk_out' diff --git a/src/admin/paths/admin@expenses@split.yaml b/src/admin/paths/admin@expenses@split.yaml index d0754dc82..b07231780 100644 --- a/src/admin/paths/admin@expenses@split.yaml +++ b/src/admin/paths/admin@expenses@split.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/admin_split_expense_in' @@ -21,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@expenses@split@check_mandatory_fields.yaml b/src/admin/paths/admin@expenses@split@check_mandatory_fields.yaml index 9a9988de2..57c713302 100644 --- a/src/admin/paths/admin@expenses@split@check_mandatory_fields.yaml +++ b/src/admin/paths/admin@expenses@split@check_mandatory_fields.yaml @@ -13,6 +13,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/admin_split_expense_in' @@ -23,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@expenses@split@check_policies.yaml b/src/admin/paths/admin@expenses@split@check_policies.yaml index e8a60dddd..0c9410c0b 100644 --- a/src/admin/paths/admin@expenses@split@check_policies.yaml +++ b/src/admin/paths/admin@expenses@split@check_policies.yaml @@ -14,6 +14,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/admin_split_expense_in' @@ -24,6 +26,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@expenses@stats.yaml b/src/admin/paths/admin@expenses@stats.yaml index ee129cee4..0bf898b7c 100644 --- a/src/admin/paths/admin@expenses@stats.yaml +++ b/src/admin/paths/admin@expenses@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expenses_stats_out' diff --git a/src/admin/paths/admin@feature_configs.yaml b/src/admin/paths/admin@feature_configs.yaml index e06443977..395c1c432 100644 --- a/src/admin/paths/admin@feature_configs.yaml +++ b/src/admin/paths/admin@feature_configs.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@files.yaml b/src/admin/paths/admin@files.yaml index 02998c601..65603ab8e 100644 --- a/src/admin/paths/admin@files.yaml +++ b/src/admin/paths/admin@files.yaml @@ -59,6 +59,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/file.yaml#/file_out diff --git a/src/admin/paths/admin@files@bulk.yaml b/src/admin/paths/admin@files@bulk.yaml index d48b10505..ffd179f21 100644 --- a/src/admin/paths/admin@files@bulk.yaml +++ b/src/admin/paths/admin@files@bulk.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@files@generate_urls@bulk.yaml b/src/admin/paths/admin@files@generate_urls@bulk.yaml index a29425341..f28de9259 100644 --- a/src/admin/paths/admin@files@generate_urls@bulk.yaml +++ b/src/admin/paths/admin@files@generate_urls@bulk.yaml @@ -32,6 +32,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@levels.yaml b/src/admin/paths/admin@levels.yaml index 0500be9db..fc01a971d 100644 --- a/src/admin/paths/admin@levels.yaml +++ b/src/admin/paths/admin@levels.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -59,6 +63,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: ../../components/schemas/level.yaml#/level_out diff --git a/src/admin/paths/admin@levels@delete@bulk.yaml b/src/admin/paths/admin@levels@delete@bulk.yaml new file mode 100644 index 000000000..15cc18888 --- /dev/null +++ b/src/admin/paths/admin@levels@delete@bulk.yaml @@ -0,0 +1,75 @@ +post: + tags: + - Levels + security: + - oauth2: ['*'] + summary: Delete levels + description: | + Deletes unused levels. If any supplied level is assigned to an employee or used in an + expense policy, the request fails without deleting any levels. A maximum of 200 unique + level IDs can be processed. Repeated IDs are deduplicated in first-seen order before the + limit is enforced. + operationId: levels_delete_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/level.yaml#/level_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + examples: + limit_exceeded: + summary: More than 200 unique level IDs supplied + value: + message: Cannot perform action for more than 200 levels at once. + data: null + error: InvalidUsage + dependency_blocked: + summary: A level is assigned or used by another resource + value: + message: Can not delete level(s) used in other resources like employee assignments, expense policy. + data: null + error: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/admin/paths/admin@levels@delete_summary@bulk.yaml b/src/admin/paths/admin@levels@delete_summary@bulk.yaml new file mode 100644 index 000000000..a605f38cd --- /dev/null +++ b/src/admin/paths/admin@levels@delete_summary@bulk.yaml @@ -0,0 +1,61 @@ +post: + tags: + - Levels + security: + - oauth2: ['*'] + summary: Get levels delete summary + description: | + Returns levels that can be deleted from the supplied IDs. Levels assigned to employees or + used in expense policies are excluded. A maximum of 200 unique level IDs can be processed. + Repeated IDs are deduplicated in first-seen order before the limit is enforced. + operationId: levels_delete_summary_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/level.yaml#/level_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '../../components/schemas/level.yaml#/level_delete_summary_out' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Cannot perform action for more than 200 levels at once. + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/admin/paths/admin@merchants.yaml b/src/admin/paths/admin@merchants.yaml index 9973180c4..6b1b7fc6d 100644 --- a/src/admin/paths/admin@merchants.yaml +++ b/src/admin/paths/admin@merchants.yaml @@ -18,6 +18,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@mileage_rates.yaml b/src/admin/paths/admin@mileage_rates.yaml index 620f9361e..7f3e8559c 100644 --- a/src/admin/paths/admin@mileage_rates.yaml +++ b/src/admin/paths/admin@mileage_rates.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -59,6 +63,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: ../../components/schemas/mileage_rate.yaml#/mileage_rate_out diff --git a/src/admin/paths/admin@mileage_rates@bulk.yaml b/src/admin/paths/admin@mileage_rates@bulk.yaml new file mode 100644 index 000000000..63dc555fd --- /dev/null +++ b/src/admin/paths/admin@mileage_rates@bulk.yaml @@ -0,0 +1,62 @@ +post: + operationId: mileage_rates_bulk_post + tags: + - Mileage Rates + security: + - oauth2: ['*'] + summary: Create or update mileage rates in bulk + description: | + Create or update mileage rates in bulk. The response is an empty object; re-fetch + `GET /admin/mileage_rates` after a successful request when the saved rows are needed. + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: ../../components/schemas/mileage_rate.yaml#/mileage_rate_in + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: ../../components/schemas/bulk_error.yaml + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: ../../components/schemas/401.yaml + '403': + description: Forbidden + content: + application/json: + schema: + $ref: ../../components/schemas/403.yaml diff --git a/src/admin/paths/admin@mileage_rates@delete@bulk.yaml b/src/admin/paths/admin@mileage_rates@delete@bulk.yaml new file mode 100644 index 000000000..9b692c129 --- /dev/null +++ b/src/admin/paths/admin@mileage_rates@delete@bulk.yaml @@ -0,0 +1,75 @@ +post: + tags: + - Mileage Rates + security: + - oauth2: ['*'] + summary: Delete mileage rates + description: | + Deletes unused mileage rates. If any supplied mileage rate is used by an expense, + the request fails without deleting any rates. A maximum of 200 unique mileage rate + IDs can be processed. Repeated IDs are deduplicated in first-seen order before the + limit is enforced. + operationId: mileage_rates_delete_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/mileage_rate.yaml#/mileage_rate_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + examples: + limit_exceeded: + summary: More than 200 unique mileage rate IDs supplied + value: + message: Cannot perform action for more than 200 mileage rates at once. + data: null + error: InvalidUsage + dependency_blocked: + summary: A mileage rate is used by an expense + value: + message: Can not delete mileage rate(s) used in other resources like expense. + data: null + error: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: "../../components/schemas/401.yaml" + '403': + description: Forbidden + content: + application/json: + schema: + $ref: "../../components/schemas/403.yaml" diff --git a/src/admin/paths/admin@mileage_rates@delete_summary@bulk.yaml b/src/admin/paths/admin@mileage_rates@delete_summary@bulk.yaml new file mode 100644 index 000000000..87c2540a0 --- /dev/null +++ b/src/admin/paths/admin@mileage_rates@delete_summary@bulk.yaml @@ -0,0 +1,61 @@ +post: + tags: + - Mileage Rates + security: + - oauth2: ['*'] + summary: Create delete summary for mileage rates + description: | + Returns how many of the supplied mileage rates can be deleted and lists those rates. + A maximum of 200 unique mileage rate IDs can be processed. Repeated IDs are + deduplicated in first-seen order before the limit is enforced. + operationId: mileage_rates_delete_summary_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/mileage_rate.yaml#/mileage_rate_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '../../components/schemas/mileage_rate.yaml#/mileage_rate_delete_summary_out' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: Cannot perform action for more than 200 mileage rates at once. + data: + type: object + nullable: true + example: null + error: + type: string + example: InvalidUsage + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: "../../components/schemas/401.yaml" + '403': + description: Forbidden + content: + application/json: + schema: + $ref: "../../components/schemas/403.yaml" diff --git a/src/admin/paths/admin@orgs.yaml b/src/admin/paths/admin@orgs.yaml index 0c0e8baba..86aac67cf 100644 --- a/src/admin/paths/admin@orgs.yaml +++ b/src/admin/paths/admin@orgs.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@orgs@weekly_invitation_usage.yaml b/src/admin/paths/admin@orgs@weekly_invitation_usage.yaml new file mode 100644 index 000000000..973e70b29 --- /dev/null +++ b/src/admin/paths/admin@orgs@weekly_invitation_usage.yaml @@ -0,0 +1,43 @@ +get: + tags: + - Organisations + summary: Get weekly employee invitation usage + description: | + This API returns the current week's employee invitation usage for the organisation. + It shows how many invitations have been sent this week, the configured weekly limit, + and whether the limit has been reached. + + If the organisation is still within its onboarding period, no weekly limit is enforced + and `weekly_limit` will be `null`. + operationId: orgs_get_weekly_invitation_usage + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/org.yaml#/org_weekly_invitation_usage_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/admin/paths/admin@orgs_bank_details.yaml b/src/admin/paths/admin@orgs_bank_details.yaml index f0a779054..df86a68f8 100644 --- a/src/admin/paths/admin@orgs_bank_details.yaml +++ b/src/admin/paths/admin@orgs_bank_details.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@per_diem_rates.yaml b/src/admin/paths/admin@per_diem_rates.yaml index 818d5e921..f363a51a8 100644 --- a/src/admin/paths/admin@per_diem_rates.yaml +++ b/src/admin/paths/admin@per_diem_rates.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -61,6 +65,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/per_diem_rate.yaml#/per_diem_rate_out diff --git a/src/admin/paths/admin@per_diem_rates@delete@bulk.yaml b/src/admin/paths/admin@per_diem_rates@delete@bulk.yaml new file mode 100644 index 000000000..8d4984072 --- /dev/null +++ b/src/admin/paths/admin@per_diem_rates@delete@bulk.yaml @@ -0,0 +1,58 @@ +post: + tags: + - Per Diem Rates + summary: Deletes per diem rates + description: | + Deletes unused per diem rates. If any of the per diem rate in input is used in other resources then validation error is raised. + operationId: per_diem_rates_delete_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/per_diem_rate.yaml#/per_diem_rate_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: "../../components/schemas/401.yaml" + '403': + description: Forbidden + content: + application/json: + schema: + $ref: "../../components/schemas/403.yaml" + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + message: + type: string + nullable: true + example: | + Can not delete per diem rate(s) used in other resources like expense. + data: + type: object + example: null + error: + type: string + example: InvalidUsage diff --git a/src/admin/paths/admin@per_diem_rates@delete_summary@bulk.yaml b/src/admin/paths/admin@per_diem_rates@delete_summary@bulk.yaml new file mode 100644 index 000000000..b0b8db765 --- /dev/null +++ b/src/admin/paths/admin@per_diem_rates@delete_summary@bulk.yaml @@ -0,0 +1,41 @@ +post: + tags: + - Per Diem Rates + summary: Create delete summary for per diem rates + description: | + Delete summary tells that how many per diem rates could be deleted from given per diem rates, it also + returns per diem rates that could be deleted. + operationId: per_diem_rates_delete_summary_bulk_post + requestBody: + required: True + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/per_diem_rate.yaml#/per_diem_rate_in_only_id' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '../../components/schemas/per_diem_rate.yaml#/per_diem_rate_delete_summary_out' + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: "../../components/schemas/401.yaml" + '403': + description: Forbidden + content: + application/json: + schema: + $ref: "../../components/schemas/403.yaml" diff --git a/src/admin/paths/admin@projects.yaml b/src/admin/paths/admin@projects.yaml index 0584021ab..d311d685d 100644 --- a/src/admin/paths/admin@projects.yaml +++ b/src/admin/paths/admin@projects.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -61,6 +65,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/project.yaml#/admin_approver_project_out diff --git a/src/admin/paths/admin@reconciliation_entries.yaml b/src/admin/paths/admin@reconciliation_entries.yaml index 7a50c125b..7b113f666 100644 --- a/src/admin/paths/admin@reconciliation_entries.yaml +++ b/src/admin/paths/admin@reconciliation_entries.yaml @@ -21,6 +21,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@reconciliation_entries@close.yaml b/src/admin/paths/admin@reconciliation_entries@close.yaml new file mode 100644 index 000000000..f491c1fdb --- /dev/null +++ b/src/admin/paths/admin@reconciliation_entries@close.yaml @@ -0,0 +1,67 @@ +post: + tags: + - Reconciliation + summary: Close reconciliation entry + description: | + Mark a reconciliation entry as reconciled/closed. + operationId: reconciliation_entries_close + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Reconciliation entry id to close. + example: receabc12345 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + description: Result of close operation. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' + diff --git a/src/admin/paths/admin@reconciliation_entries@eligible_cards.yaml b/src/admin/paths/admin@reconciliation_entries@eligible_cards.yaml index 70edaeb24..c0730fb9c 100644 --- a/src/admin/paths/admin@reconciliation_entries@eligible_cards.yaml +++ b/src/admin/paths/admin@reconciliation_entries@eligible_cards.yaml @@ -34,6 +34,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@reconciliation_entries@eligible_cards@exports.yaml b/src/admin/paths/admin@reconciliation_entries@eligible_cards@exports.yaml new file mode 100644 index 000000000..04c6923c2 --- /dev/null +++ b/src/admin/paths/admin@reconciliation_entries@eligible_cards@exports.yaml @@ -0,0 +1,58 @@ +post: + tags: + - Reconciliation + summary: Create eligible cards export + description: | + Create an export request for reconciliation eligible cards. The export is processed asynchronously. + When ready, the specified notify_emails will receive the export file. Use query_params to filter + the eligible cards (e.g. reconciliation_entry_id=eq.). + operationId: reconciliation_eligible_cards_exports_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/reconciliation_exports.yaml#/reconciliation_export_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/reconciliation_exports.yaml#/reconciliation_export_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@reconciliation_entries@eligible_cards@stats.yaml b/src/admin/paths/admin@reconciliation_entries@eligible_cards@stats.yaml index d36857e54..c7c16dcf5 100644 --- a/src/admin/paths/admin@reconciliation_entries@eligible_cards@stats.yaml +++ b/src/admin/paths/admin@reconciliation_entries@eligible_cards@stats.yaml @@ -26,6 +26,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/admin/paths/admin@reconciliation_entries@transactions.yaml b/src/admin/paths/admin@reconciliation_entries@transactions.yaml index 7d364fcc9..1a5ebc2c3 100644 --- a/src/admin/paths/admin@reconciliation_entries@transactions.yaml +++ b/src/admin/paths/admin@reconciliation_entries@transactions.yaml @@ -46,6 +46,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@reconciliation_entries@transactions@delete@bulk.yaml b/src/admin/paths/admin@reconciliation_entries@transactions@delete@bulk.yaml new file mode 100644 index 000000000..c2f5a66c2 --- /dev/null +++ b/src/admin/paths/admin@reconciliation_entries@transactions@delete@bulk.yaml @@ -0,0 +1,85 @@ +post: + tags: + - Reconciliation + summary: Bulk delete reconciliation transactions + description: | + Delete multiple reconciliation transactions in bulk. + operationId: reconciliation_transactions_delete_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: List of reconciliation transaction identifiers to delete. + items: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Unique id of the reconciliation transaction to delete. + example: rectx8abc123 + example: + - id: rectx8abc123 + - id: rectx8xyz789 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + description: Result of bulk delete. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/bulk_error.yaml' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' + diff --git a/src/admin/paths/admin@reconciliation_entries@transactions@exports.yaml b/src/admin/paths/admin@reconciliation_entries@transactions@exports.yaml new file mode 100644 index 000000000..d1b11f39c --- /dev/null +++ b/src/admin/paths/admin@reconciliation_entries@transactions@exports.yaml @@ -0,0 +1,58 @@ +post: + tags: + - Reconciliation + summary: Create transactions export + description: | + Create an export request for reconciliation transactions. The export is processed asynchronously. + When ready, the specified notify_emails will receive the export file. Use query_params to filter + the transactions (e.g. reconciliation_entry_id=eq.). + operationId: reconciliation_transactions_exports_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/reconciliation_exports.yaml#/reconciliation_export_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/reconciliation_exports.yaml#/reconciliation_export_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@reconciliation_entries@transactions@find_match.yaml b/src/admin/paths/admin@reconciliation_entries@transactions@find_match.yaml new file mode 100644 index 000000000..149cac5f6 --- /dev/null +++ b/src/admin/paths/admin@reconciliation_entries@transactions@find_match.yaml @@ -0,0 +1,68 @@ +post: + tags: + - Reconciliation + summary: Find matches for a reconciliation transaction + description: | + Find potential matching expenses for a reconciliation transaction. + operationId: reconciliation_transactions_find_match + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Unique id of the reconciliation transaction for which to find matches. + example: rectx8abc123 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + additionalProperties: false + properties: + data: + type: array + description: List of potential matches for the provided reconciliation transaction. + items: + $ref: '../../components/schemas/reconciliation_transactions.yaml#/reconciliation_transaction_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' + diff --git a/src/admin/paths/admin@reconciliation_entries@transactions@match_and_reconcile@bulk.yaml b/src/admin/paths/admin@reconciliation_entries@transactions@match_and_reconcile@bulk.yaml new file mode 100644 index 000000000..08ba7772c --- /dev/null +++ b/src/admin/paths/admin@reconciliation_entries@transactions@match_and_reconcile@bulk.yaml @@ -0,0 +1,92 @@ +post: + tags: + - Reconciliation + summary: Bulk match and reconcile reconciliation transactions + description: | + Match reconciliation transactions with target transactions/expenses and reconcile in bulk. + operationId: reconciliation_transactions_match_and_reconcile_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: List of source and target reconciliation transaction identifiers to match and reconcile. + items: + type: object + additionalProperties: false + required: + - source_id + - target_id + properties: + source_id: + type: string + description: Source reconciliation transaction id. + example: rectx8abc123 + target_id: + type: string + description: Target reconciliation transaction or expense id to match with. + example: rectx8xyz789 + example: + - source_id: rectx8abc123 + target_id: rectx8xyz789 + - source_id: rectx8def456 + target_id: rectx8uvw000 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + description: Result of bulk match and reconcile. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/bulk_error.yaml' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' + diff --git a/src/admin/paths/admin@reconciliation_entries@transactions@move_to_next_period@bulk.yaml b/src/admin/paths/admin@reconciliation_entries@transactions@move_to_next_period@bulk.yaml index e9b88c92c..a21847a8d 100644 --- a/src/admin/paths/admin@reconciliation_entries@transactions@move_to_next_period@bulk.yaml +++ b/src/admin/paths/admin@reconciliation_entries@transactions@move_to_next_period@bulk.yaml @@ -31,6 +31,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: object diff --git a/src/admin/paths/admin@reconciliation_entries@transactions@reconcile@bulk.yaml b/src/admin/paths/admin@reconciliation_entries@transactions@reconcile@bulk.yaml new file mode 100644 index 000000000..b93a11236 --- /dev/null +++ b/src/admin/paths/admin@reconciliation_entries@transactions@reconcile@bulk.yaml @@ -0,0 +1,85 @@ +post: + tags: + - Reconciliation + summary: Bulk reconcile reconciliation transactions + description: | + Reconcile multiple reconciliation transactions in bulk. + operationId: reconciliation_transactions_reconcile_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: List of reconciliation transaction identifiers to reconcile. + items: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Unique id of the reconciliation transaction to reconcile. + example: rectx8abc123 + example: + - id: rectx8abc123 + - id: rectx8xyz789 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + description: Result of bulk reconcile. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/bulk_error.yaml' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' + diff --git a/src/admin/paths/admin@reconciliation_entries@transactions@resolve_multi_matches.yaml b/src/admin/paths/admin@reconciliation_entries@transactions@resolve_multi_matches.yaml new file mode 100644 index 000000000..246efefd8 --- /dev/null +++ b/src/admin/paths/admin@reconciliation_entries@transactions@resolve_multi_matches.yaml @@ -0,0 +1,72 @@ +post: + tags: + - Reconciliation + summary: Resolve multiple matches for a reconciliation transaction + description: | + Resolve multiple potential matches by selecting a specific expense for a reconciliation transaction. + operationId: reconciliation_transactions_resolve_multi_matches + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + additionalProperties: false + required: + - id + - expense_id + properties: + id: + type: string + description: Reconciliation transaction id for which to resolve multiple matches. + example: rectx8abc123 + expense_id: + type: string + description: Selected expense id to resolve against. + example: txuXDH16HzK + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + description: Result of resolve operation. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' + diff --git a/src/admin/paths/admin@reconciliation_entries@transactions@stats.yaml b/src/admin/paths/admin@reconciliation_entries@transactions@stats.yaml index 4a291f7f5..60d0a3581 100644 --- a/src/admin/paths/admin@reconciliation_entries@transactions@stats.yaml +++ b/src/admin/paths/admin@reconciliation_entries@transactions@stats.yaml @@ -26,6 +26,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/admin/paths/admin@reconciliation_entries@transactions@unmatch@bulk.yaml b/src/admin/paths/admin@reconciliation_entries@transactions@unmatch@bulk.yaml new file mode 100644 index 000000000..0af2981f0 --- /dev/null +++ b/src/admin/paths/admin@reconciliation_entries@transactions@unmatch@bulk.yaml @@ -0,0 +1,85 @@ +post: + tags: + - Reconciliation + summary: Bulk unmatch reconciliation transactions + description: | + Unmatch multiple reconciliation transactions in bulk. + operationId: reconciliation_transactions_unmatch_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: array + description: List of reconciliation transaction identifiers to unmatch. + items: + type: object + additionalProperties: false + required: + - id + properties: + id: + type: string + description: Unique id of the reconciliation transaction to unmatch. + example: rectx8abc123 + example: + - id: rectx8abc123 + - id: rectx8xyz789 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + description: Result of bulk unmatch. Empty object on success. + example: {} + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/bulk_error.yaml' + - type: object + properties: + error: + type: string + nullable: true + message: + type: string + nullable: true + data: + type: object + nullable: true + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' + diff --git a/src/admin/paths/admin@reimbursements.yaml b/src/admin/paths/admin@reimbursements.yaml index cd4abef70..4a0a73194 100644 --- a/src/admin/paths/admin@reimbursements.yaml +++ b/src/admin/paths/admin@reimbursements.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@reimbursements@mark_complete.yaml b/src/admin/paths/admin@reimbursements@mark_complete.yaml index 5dce2ef6e..5f29952d4 100644 --- a/src/admin/paths/admin@reimbursements@mark_complete.yaml +++ b/src/admin/paths/admin@reimbursements@mark_complete.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/reimbursement.yaml#/reimbursement_out' diff --git a/src/admin/paths/admin@reminders.yaml b/src/admin/paths/admin@reminders.yaml index cb78507fc..7aa19a6bf 100644 --- a/src/admin/paths/admin@reminders.yaml +++ b/src/admin/paths/admin@reminders.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -61,6 +65,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/reminder.yaml#/reminder_out diff --git a/src/admin/paths/admin@reminders@delete.yaml b/src/admin/paths/admin@reminders@delete.yaml index 95ec9b7e0..3e060b578 100644 --- a/src/admin/paths/admin@reminders@delete.yaml +++ b/src/admin/paths/admin@reminders@delete.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/admin/paths/admin@reminders@stats.yaml b/src/admin/paths/admin@reminders@stats.yaml index 3cca816f3..e22926d51 100644 --- a/src/admin/paths/admin@reminders@stats.yaml +++ b/src/admin/paths/admin@reminders@stats.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/admin/paths/admin@reports.yaml b/src/admin/paths/admin@reports.yaml index a4a713f57..f27685cb3 100644 --- a/src/admin/paths/admin@reports.yaml +++ b/src/admin/paths/admin@reports.yaml @@ -14,6 +14,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@reports@add_approver.yaml b/src/admin/paths/admin@reports@add_approver.yaml index 226ad05bd..19a0e87f0 100644 --- a/src/admin/paths/admin@reports@add_approver.yaml +++ b/src/admin/paths/admin@reports@add_approver.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/admin_report_out' diff --git a/src/admin/paths/admin@reports@apply_advance_wallets.yaml b/src/admin/paths/admin@reports@apply_advance_wallets.yaml index fceba0263..c5fee00fa 100644 --- a/src/admin/paths/admin@reports@apply_advance_wallets.yaml +++ b/src/admin/paths/admin@reports@apply_advance_wallets.yaml @@ -24,6 +24,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/admin_report_out' diff --git a/src/admin/paths/admin@reports@comments.yaml b/src/admin/paths/admin@reports@comments.yaml index 9b48e93b2..ffdef235d 100644 --- a/src/admin/paths/admin@reports@comments.yaml +++ b/src/admin/paths/admin@reports@comments.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_comments_out' diff --git a/src/admin/paths/admin@reports@delete_filter.yaml b/src/admin/paths/admin@reports@delete_filter.yaml index 50d56712a..63bceca83 100644 --- a/src/admin/paths/admin@reports@delete_filter.yaml +++ b/src/admin/paths/admin@reports@delete_filter.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/report_filters.yaml#/report_filters_out' diff --git a/src/admin/paths/admin@reports@eject_expenses.yaml b/src/admin/paths/admin@reports@eject_expenses.yaml index d293caddb..3a9717f45 100644 --- a/src/admin/paths/admin@reports@eject_expenses.yaml +++ b/src/admin/paths/admin@reports@eject_expenses.yaml @@ -30,6 +30,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/admin_report_out' diff --git a/src/admin/paths/admin@reports@export_configurations.yaml b/src/admin/paths/admin@reports@export_configurations.yaml index e69a1dbb3..d544fa796 100644 --- a/src/admin/paths/admin@reports@export_configurations.yaml +++ b/src/admin/paths/admin@reports@export_configurations.yaml @@ -17,6 +17,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -66,6 +70,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/reports_export_configurations.yaml#/reports_export_configuration_out' diff --git a/src/admin/paths/admin@reports@exports.yaml b/src/admin/paths/admin@reports@exports.yaml index 4ed93d118..248ff4d59 100644 --- a/src/admin/paths/admin@reports@exports.yaml +++ b/src/admin/paths/admin@reports@exports.yaml @@ -11,6 +11,11 @@ get: content: application/json: schema: + type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -58,6 +63,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/reports_exports.yaml#/reports_exports_out' diff --git a/src/admin/paths/admin@reports@permissions.yaml b/src/admin/paths/admin@reports@permissions.yaml index 00c0674d9..71ca3ad25 100644 --- a/src/admin/paths/admin@reports@permissions.yaml +++ b/src/admin/paths/admin@reports@permissions.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report_permissions.yaml#/report_permissions_out' diff --git a/src/admin/paths/admin@reports@process_summary@bulk.yaml b/src/admin/paths/admin@reports@process_summary@bulk.yaml index 7ca2d35c9..84f8a99f4 100644 --- a/src/admin/paths/admin@reports@process_summary@bulk.yaml +++ b/src/admin/paths/admin@reports@process_summary@bulk.yaml @@ -26,6 +26,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/admin/paths/admin@reports@remove_advance_wallets.yaml b/src/admin/paths/admin@reports@remove_advance_wallets.yaml index ebc30e859..f4675ef0a 100644 --- a/src/admin/paths/admin@reports@remove_advance_wallets.yaml +++ b/src/admin/paths/admin@reports@remove_advance_wallets.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/admin_report_out' diff --git a/src/admin/paths/admin@reports@remove_approver.yaml b/src/admin/paths/admin@reports@remove_approver.yaml index a305e8946..cf117eacd 100644 --- a/src/admin/paths/admin@reports@remove_approver.yaml +++ b/src/admin/paths/admin@reports@remove_approver.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/admin_report_out' diff --git a/src/admin/paths/admin@reports@resubmit.yaml b/src/admin/paths/admin@reports@resubmit.yaml new file mode 100644 index 000000000..d27b766ad --- /dev/null +++ b/src/admin/paths/admin@reports@resubmit.yaml @@ -0,0 +1,55 @@ +post: + tags: + - Reports + summary: Resubmit an employee's report + description: Resubmit an employee's report that is in the `APPROVER_INQUIRY` state. + operationId: report_resubmit + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/report.yaml#/report_action_resubmit' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/report.yaml#/admin_report_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@reports@revert_to_approved.yaml b/src/admin/paths/admin@reports@revert_to_approved.yaml new file mode 100644 index 000000000..51e3af78d --- /dev/null +++ b/src/admin/paths/admin@reports@revert_to_approved.yaml @@ -0,0 +1,61 @@ +post: + tags: + - Reports + summary: Revert report to Approved state + description: | + Move a Closed or Processing report back to Approved state. + operationId: report_revert_to_approved + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/report.yaml#/revert_to_approved_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/report.yaml#/admin_report_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + type: object + properties: + message: + type: string + description: | + This error means current user does not have enough permissions to perform this operation. + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@reports@revert_to_processing.yaml b/src/admin/paths/admin@reports@revert_to_processing.yaml new file mode 100644 index 000000000..22ab342dc --- /dev/null +++ b/src/admin/paths/admin@reports@revert_to_processing.yaml @@ -0,0 +1,61 @@ +post: + tags: + - Reports + summary: Revert report to Processing + description: | + Move a Closed report back to Processing state. + operationId: report_revert_to_processing + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/report.yaml#/revert_to_processing_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/report.yaml#/admin_report_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + type: object + properties: + message: + type: string + description: | + This error means current user does not have enough permissions to perform this operation. + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@reports@round_off_amount.yaml b/src/admin/paths/admin@reports@round_off_amount.yaml index 06614451f..f99731a3a 100644 --- a/src/admin/paths/admin@reports@round_off_amount.yaml +++ b/src/admin/paths/admin@reports@round_off_amount.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/admin_report_out' diff --git a/src/admin/paths/admin@reports@save_filters.yaml b/src/admin/paths/admin@reports@save_filters.yaml index 06107026f..2da3220ee 100644 --- a/src/admin/paths/admin@reports@save_filters.yaml +++ b/src/admin/paths/admin@reports@save_filters.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/report_filters.yaml#/report_filters_out' @@ -59,6 +61,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: data: type: array diff --git a/src/admin/paths/admin@reports@send_back.yaml b/src/admin/paths/admin@reports@send_back.yaml index acd3ca98d..3cc52c0aa 100644 --- a/src/admin/paths/admin@reports@send_back.yaml +++ b/src/admin/paths/admin@reports@send_back.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/admin_report_out' diff --git a/src/admin/paths/admin@reports@stats.yaml b/src/admin/paths/admin@reports@stats.yaml index bd00c4e13..029c82d13 100644 --- a/src/admin/paths/admin@reports@stats.yaml +++ b/src/admin/paths/admin@reports@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/reports_stats_out' diff --git a/src/admin/paths/admin@scheduled_callbacks.yaml b/src/admin/paths/admin@scheduled_callbacks.yaml index dda8e5246..d6b9f008f 100644 --- a/src/admin/paths/admin@scheduled_callbacks.yaml +++ b/src/admin/paths/admin@scheduled_callbacks.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/scheduled_callback.yaml#/scheduled_callback_out @@ -69,6 +71,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@schedules.yaml b/src/admin/paths/admin@schedules.yaml index 9101cb9a6..c6e4eb8ca 100644 --- a/src/admin/paths/admin@schedules.yaml +++ b/src/admin/paths/admin@schedules.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/schedule.yaml#/schedule_out @@ -69,6 +71,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@spend_overview@by_category.yaml b/src/admin/paths/admin@spend_overview@by_category.yaml index b5eae8982..5a2b1ff01 100644 --- a/src/admin/paths/admin@spend_overview@by_category.yaml +++ b/src/admin/paths/admin@spend_overview@by_category.yaml @@ -22,6 +22,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@spend_overview@by_corporate_card.yaml b/src/admin/paths/admin@spend_overview@by_corporate_card.yaml index 8aed50fb0..b6e39f854 100644 --- a/src/admin/paths/admin@spend_overview@by_corporate_card.yaml +++ b/src/admin/paths/admin@spend_overview@by_corporate_card.yaml @@ -22,6 +22,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@spend_overview@by_department.yaml b/src/admin/paths/admin@spend_overview@by_department.yaml index 6c2069b82..59cf186d8 100644 --- a/src/admin/paths/admin@spend_overview@by_department.yaml +++ b/src/admin/paths/admin@spend_overview@by_department.yaml @@ -22,6 +22,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@spend_overview@by_merchant.yaml b/src/admin/paths/admin@spend_overview@by_merchant.yaml index 64b851404..9469eb651 100644 --- a/src/admin/paths/admin@spend_overview@by_merchant.yaml +++ b/src/admin/paths/admin@spend_overview@by_merchant.yaml @@ -22,6 +22,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@spend_overview@by_project.yaml b/src/admin/paths/admin@spend_overview@by_project.yaml index da9283de7..3b6eb4d9a 100644 --- a/src/admin/paths/admin@spend_overview@by_project.yaml +++ b/src/admin/paths/admin@spend_overview@by_project.yaml @@ -22,6 +22,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@spend_overview@by_user.yaml b/src/admin/paths/admin@spend_overview@by_user.yaml index bfbdce23f..799e7ffa0 100644 --- a/src/admin/paths/admin@spend_overview@by_user.yaml +++ b/src/admin/paths/admin@spend_overview@by_user.yaml @@ -22,6 +22,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@spend_overview@summary.yaml b/src/admin/paths/admin@spend_overview@summary.yaml index 1dc40885e..021f4fede 100644 --- a/src/admin/paths/admin@spend_overview@summary.yaml +++ b/src/admin/paths/admin@spend_overview@summary.yaml @@ -26,6 +26,8 @@ get: application/json: schema: type: object + required: + - data properties: time_interval_granularity: $ref: ../../components/schemas/fields.yaml#/time_interval_granularity diff --git a/src/admin/paths/admin@statement_mappings.yaml b/src/admin/paths/admin@statement_mappings.yaml index 8fa4605fa..23a33d59b 100644 --- a/src/admin/paths/admin@statement_mappings.yaml +++ b/src/admin/paths/admin@statement_mappings.yaml @@ -18,6 +18,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@statements.yaml b/src/admin/paths/admin@statements.yaml index 67ae9c7a9..1614bfea1 100644 --- a/src/admin/paths/admin@statements.yaml +++ b/src/admin/paths/admin@statements.yaml @@ -18,6 +18,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@statements@archived_cards.yaml b/src/admin/paths/admin@statements@archived_cards.yaml new file mode 100644 index 000000000..0057464d6 --- /dev/null +++ b/src/admin/paths/admin@statements@archived_cards.yaml @@ -0,0 +1,54 @@ +post: + tags: + - Statements + summary: Archived cards present in Sage Exp Mgmt + description: | + Returns archived cards present in Sage Exp Mgmt for cards in Statement + operationId: archived_cards + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '../../components/schemas/statements.yaml#/statement_archived_cards_in' + required: + - data + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '../../components/schemas/statements.yaml#/statement_archived_cards_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@statements@archived_cards@ignore.yaml b/src/admin/paths/admin@statements@archived_cards@ignore.yaml new file mode 100644 index 000000000..575dc0970 --- /dev/null +++ b/src/admin/paths/admin@statements@archived_cards@ignore.yaml @@ -0,0 +1,55 @@ +post: + tags: + - Statements + summary: Ignore archived cards present in the statement + description: | + Ignores archived cards present in the statement + operationId: ignore_archived_cards + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '../../components/schemas/statements.yaml#/statement_archived_cards_ignore_in' + required: + - data + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + description: Empty object on successfully ignoring archived cards + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' diff --git a/src/admin/paths/admin@statements@card_stats.yaml b/src/admin/paths/admin@statements@card_stats.yaml index 5906f74f6..3a9d20431 100644 --- a/src/admin/paths/admin@statements@card_stats.yaml +++ b/src/admin/paths/admin@statements@card_stats.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/statements.yaml#/card_stats_out' diff --git a/src/admin/paths/admin@statements@matching_cards.yaml b/src/admin/paths/admin@statements@matching_cards.yaml index 05cf558fa..68b4b9aa6 100644 --- a/src/admin/paths/admin@statements@matching_cards.yaml +++ b/src/admin/paths/admin@statements@matching_cards.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@statements@missing_transactions.yaml b/src/admin/paths/admin@statements@missing_transactions.yaml index 02f97fb47..e040f7c39 100644 --- a/src/admin/paths/admin@statements@missing_transactions.yaml +++ b/src/admin/paths/admin@statements@missing_transactions.yaml @@ -62,11 +62,11 @@ get: schema: type: object additionalProperties: False + required: + - data properties: data: - type: object - items: - $ref: ../../components/schemas/statements.yaml#/rtf_missing_transaction_from_statement_out + $ref: ../../components/schemas/statements.yaml#/rtf_missing_transaction_from_statement_out '400': description: Bad Request content: diff --git a/src/admin/paths/admin@statements@preview.yaml b/src/admin/paths/admin@statements@preview.yaml index 5a21fb962..f57f87bb3 100644 --- a/src/admin/paths/admin@statements@preview.yaml +++ b/src/admin/paths/admin@statements@preview.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/statements.yaml#/preview_out' diff --git a/src/admin/paths/admin@statements@reconcile.yaml b/src/admin/paths/admin@statements@reconcile.yaml index d35298686..1669a3032 100644 --- a/src/admin/paths/admin@statements@reconcile.yaml +++ b/src/admin/paths/admin@statements@reconcile.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: object diff --git a/src/admin/paths/admin@statements@reconciliation_summary.yaml b/src/admin/paths/admin@statements@reconciliation_summary.yaml index e752af7ef..720d339d1 100644 --- a/src/admin/paths/admin@statements@reconciliation_summary.yaml +++ b/src/admin/paths/admin@statements@reconciliation_summary.yaml @@ -23,11 +23,11 @@ post: application/json: schema: type: object + required: + - data properties: data: - type: array - items: - $ref: '../../components/schemas/statements.yaml#/reconciliation_summary_out' + $ref: '../../components/schemas/statements.yaml#/reconciliation_summary_out' '400': description: Bad request content: diff --git a/src/admin/paths/admin@statements@rtf_stats.yaml b/src/admin/paths/admin@statements@rtf_stats.yaml index 606e1c132..dc047fda3 100644 --- a/src/admin/paths/admin@statements@rtf_stats.yaml +++ b/src/admin/paths/admin@statements@rtf_stats.yaml @@ -13,11 +13,11 @@ get: schema: type: object additionalProperties: False + required: + - data properties: data: - type: object - items: - $ref: ../../components/schemas/statements.yaml#/rtf_stats_out + $ref: ../../components/schemas/statements.yaml#/rtf_stats_out '400': description: Bad request content: diff --git a/src/admin/paths/admin@statements@suggest_mappings.yaml b/src/admin/paths/admin@statements@suggest_mappings.yaml index 9343af7e8..c75dad7b8 100644 --- a/src/admin/paths/admin@statements@suggest_mappings.yaml +++ b/src/admin/paths/admin@statements@suggest_mappings.yaml @@ -31,15 +31,15 @@ post: application/json: schema: type: object + required: + - data properties: count: $ref: '../../components/schemas/count.yaml' offset: $ref: '../../components/schemas/offset.yaml' data: - type: object - items: - $ref: '../../components/schemas/statement_mappings.yaml#/statement_mappings_suggest_out' + $ref: '../../components/schemas/statement_mappings.yaml#/statement_mappings_suggest_out' '400': description: Bad request content: diff --git a/src/admin/paths/admin@statements@summary.yaml b/src/admin/paths/admin@statements@summary.yaml index f0e6aca4c..6da4d23c5 100644 --- a/src/admin/paths/admin@statements@summary.yaml +++ b/src/admin/paths/admin@statements@summary.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@statements@unassigned_cards.yaml b/src/admin/paths/admin@statements@unassigned_cards.yaml index 515510f52..18fc4f299 100644 --- a/src/admin/paths/admin@statements@unassigned_cards.yaml +++ b/src/admin/paths/admin@statements@unassigned_cards.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/admin/paths/admin@statements@upload.yaml b/src/admin/paths/admin@statements@upload.yaml index c14faeba1..704d3c069 100644 --- a/src/admin/paths/admin@statements@upload.yaml +++ b/src/admin/paths/admin@statements@upload.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/statements.yaml#/statements_out' diff --git a/src/admin/paths/admin@subscriptions.yaml b/src/admin/paths/admin@subscriptions.yaml index 77680a285..dc8b04e6e 100644 --- a/src/admin/paths/admin@subscriptions.yaml +++ b/src/admin/paths/admin@subscriptions.yaml @@ -11,6 +11,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/subscriptions.yaml#/admin_subscriptions_in' @@ -22,6 +24,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/subscriptions.yaml#/admin_subscriptions_out' @@ -72,6 +76,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/admin/paths/admin@tax_groups.yaml b/src/admin/paths/admin@tax_groups.yaml index bb82f48f3..f0551647f 100644 --- a/src/admin/paths/admin@tax_groups.yaml +++ b/src/admin/paths/admin@tax_groups.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -61,6 +65,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/tax_group.yaml#/tax_group_out' diff --git a/src/admin/paths/admin@virtual_cards.yaml b/src/admin/paths/admin@virtual_cards.yaml index e335c47e0..0975de9b8 100644 --- a/src/admin/paths/admin@virtual_cards.yaml +++ b/src/admin/paths/admin@virtual_cards.yaml @@ -18,6 +18,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/admin/paths/admin@virtual_cards@delete.yaml b/src/admin/paths/admin@virtual_cards@delete.yaml index 065ae1e09..7ca783e98 100644 --- a/src/admin/paths/admin@virtual_cards@delete.yaml +++ b/src/admin/paths/admin@virtual_cards@delete.yaml @@ -25,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/virtual_card.yaml#/virtual_card_out' diff --git a/src/admin/paths/admin@virtual_cards@get_current_amount.yaml b/src/admin/paths/admin@virtual_cards@get_current_amount.yaml index b326a885c..4e422c72f 100644 --- a/src/admin/paths/admin@virtual_cards@get_current_amount.yaml +++ b/src/admin/paths/admin@virtual_cards@get_current_amount.yaml @@ -25,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/virtual_card.yaml#/virtual_cards_get_current_balance_out' diff --git a/src/admin/paths/admin@virtual_cards@show_card_details.yaml b/src/admin/paths/admin@virtual_cards@show_card_details.yaml index e1b3bcc92..ac9d647f2 100644 --- a/src/admin/paths/admin@virtual_cards@show_card_details.yaml +++ b/src/admin/paths/admin@virtual_cards@show_card_details.yaml @@ -25,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/virtual_card.yaml#/virtual_cards_show_card_details_out' diff --git a/src/approver/openapi.yaml b/src/approver/openapi.yaml index 80075d34f..b09ca9d7d 100644 --- a/src/approver/openapi.yaml +++ b/src/approver/openapi.yaml @@ -18,7 +18,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' @@ -35,9 +35,9 @@ tags: - name: Cost Centers description: | These APIs gives you access to manage your organisation's Cost Centers -# - name: Corporate Cards -# description: | -# This API gives you access to perform action on Corporate Cards and their transactions. + - name: Corporate Cards + description: | + This API gives you access to view Corporate Cards across organisations where user is approver. - name: Per Diem Rates description: | This API gives you access to manage your organisation's Per Diem Rates @@ -79,6 +79,8 @@ paths: $ref: paths/approver@reports@exports.yaml /approver/expenses: $ref: 'paths/approver@expenses.yaml' + /approver/expenses/bulk: + $ref: 'paths/approver@expenses@bulk.yaml' /approver/expenses/attach_files/bulk : $ref: paths/approver@expenses@attach_files@bulk.yaml /approver/expenses/permissions: @@ -120,6 +122,8 @@ paths: $ref: paths/approver@projects.yaml /approver/categories: $ref: paths/approver@categories.yaml + /approver/corporate_cards: + $ref: paths/approver@corporate_cards.yaml /approver/cost_centers: $ref: paths/approver@cost_centers.yaml /approver/per_diem_rates: @@ -136,6 +140,10 @@ paths: $ref: paths/approver@expense_policies@states.yaml /approver/expenses/check_mandatory_fields: $ref: paths/approver@expenses@check_mandatory_fields.yaml + /approver/expenses/check_mandatory_fields/bulk: + $ref: paths/approver@expenses@check_mandatory_fields_bulk.yaml + /approver/expenses/check_policies/bulk: + $ref: paths/approver@expenses@check_policies_bulk.yaml /approver/expenses/comments: $ref: paths/approver@expenses@comments.yaml /approver/expenses/comments/bulk: diff --git a/src/approver/paths/approver@accounts.yaml b/src/approver/paths/approver@accounts.yaml index 43ad7d79c..bc902258f 100644 --- a/src/approver/paths/approver@accounts.yaml +++ b/src/approver/paths/approver@accounts.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: false + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/approver/paths/approver@advance_requests.yaml b/src/approver/paths/approver@advance_requests.yaml index 22b4b80e9..53e70768a 100644 --- a/src/approver/paths/approver@advance_requests.yaml +++ b/src/approver/paths/approver@advance_requests.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/approver/paths/approver@advance_requests@add_approver.yaml b/src/approver/paths/approver@advance_requests@add_approver.yaml index 81c08199f..7685fd3e4 100644 --- a/src/approver/paths/approver@advance_requests@add_approver.yaml +++ b/src/approver/paths/approver@advance_requests@add_approver.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_add_approver_in' @@ -26,6 +28,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/approver/paths/approver@advance_requests@bulk_attach_file.yaml b/src/approver/paths/approver@advance_requests@bulk_attach_file.yaml index 14065e4b1..8da910c34 100644 --- a/src/approver/paths/approver@advance_requests@bulk_attach_file.yaml +++ b/src/approver/paths/approver@advance_requests@bulk_attach_file.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@advance_requests@comments.yaml b/src/approver/paths/approver@advance_requests@comments.yaml index 81f9ea81d..2ce3237c2 100644 --- a/src/approver/paths/approver@advance_requests@comments.yaml +++ b/src/approver/paths/approver@advance_requests@comments.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_comments_in' @@ -21,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_comments_out' diff --git a/src/approver/paths/approver@advance_requests@custom_fields.yaml b/src/approver/paths/approver@advance_requests@custom_fields.yaml index 674e1b21e..75d8b1009 100644 --- a/src/approver/paths/approver@advance_requests@custom_fields.yaml +++ b/src/approver/paths/approver@advance_requests@custom_fields.yaml @@ -12,6 +12,8 @@ get: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_custom_fields_out' diff --git a/src/approver/paths/approver@advance_requests@generate_file_urls@bulk.yaml b/src/approver/paths/approver@advance_requests@generate_file_urls@bulk.yaml index 66b6174f8..3b633a735 100644 --- a/src/approver/paths/approver@advance_requests@generate_file_urls@bulk.yaml +++ b/src/approver/paths/approver@advance_requests@generate_file_urls@bulk.yaml @@ -32,6 +32,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@advance_requests@inquire.yaml b/src/approver/paths/approver@advance_requests@inquire.yaml index 806a56798..da8dd2440 100644 --- a/src/approver/paths/approver@advance_requests@inquire.yaml +++ b/src/approver/paths/approver@advance_requests@inquire.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/approver/paths/approver@advance_requests@partially_approve.yaml b/src/approver/paths/approver@advance_requests@partially_approve.yaml index 0068c6c50..13bbc1386 100644 --- a/src/approver/paths/approver@advance_requests@partially_approve.yaml +++ b/src/approver/paths/approver@advance_requests@partially_approve.yaml @@ -26,6 +26,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/approver/paths/approver@advance_requests@permissions.yaml b/src/approver/paths/approver@advance_requests@permissions.yaml index 744da3b9f..8f5d4031b 100644 --- a/src/approver/paths/approver@advance_requests@permissions.yaml +++ b/src/approver/paths/approver@advance_requests@permissions.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_permissions_out' diff --git a/src/approver/paths/approver@advance_requests@reject.yaml b/src/approver/paths/approver@advance_requests@reject.yaml index 0930de8e2..c2df92a74 100644 --- a/src/approver/paths/approver@advance_requests@reject.yaml +++ b/src/approver/paths/approver@advance_requests@reject.yaml @@ -29,6 +29,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/approver/paths/approver@advance_requests@stats.yaml b/src/approver/paths/approver@advance_requests@stats.yaml index 9e16193ec..d778f6fac 100644 --- a/src/approver/paths/approver@advance_requests@stats.yaml +++ b/src/approver/paths/approver@advance_requests@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_requests_approver_stats_out' diff --git a/src/approver/paths/approver@advance_requests@submit.yaml b/src/approver/paths/approver@advance_requests@submit.yaml index 8abfe8cf7..287fae1b2 100644 --- a/src/approver/paths/approver@advance_requests@submit.yaml +++ b/src/approver/paths/approver@advance_requests@submit.yaml @@ -16,7 +16,7 @@ post: - data properties: data: - $ref: '../../components/schemas/advance_request.yaml#/advance_request_in' + $ref: '../../components/schemas/advance_request.yaml#/advance_request_submit_in' responses: '200': description: OK @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' @@ -61,4 +63,4 @@ post: message: type: string description: | - This error means the requested resource was not found or the requester doesn't have sufficient access. \ No newline at end of file + This error means the requested resource was not found or the requester doesn't have sufficient access. diff --git a/src/approver/paths/approver@categories.yaml b/src/approver/paths/approver@categories.yaml index 382caeea9..5fea0cbb3 100644 --- a/src/approver/paths/approver@categories.yaml +++ b/src/approver/paths/approver@categories.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/approver/paths/approver@corporate_card_transactions@match.yaml b/src/approver/paths/approver@corporate_card_transactions@match.yaml index 4c60ece64..7cbe00818 100644 --- a/src/approver/paths/approver@corporate_card_transactions@match.yaml +++ b/src/approver/paths/approver@corporate_card_transactions@match.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_match_out' diff --git a/src/approver/paths/approver@corporate_card_transactions@unmatch.yaml b/src/approver/paths/approver@corporate_card_transactions@unmatch.yaml index 561fa70a1..01c7bdec8 100644 --- a/src/approver/paths/approver@corporate_card_transactions@unmatch.yaml +++ b/src/approver/paths/approver@corporate_card_transactions@unmatch.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_unmatch_out' diff --git a/src/approver/paths/approver@corporate_cards.yaml b/src/approver/paths/approver@corporate_cards.yaml new file mode 100644 index 000000000..bf30b3550 --- /dev/null +++ b/src/approver/paths/approver@corporate_cards.yaml @@ -0,0 +1,54 @@ +get: + tags: + - Corporate Cards + summary: List corporate cards + description: | + Returns corporate cards from all organisations where user is approver. + + This API supports very rich filtering on all response fields and pagination via query parameters. To understand how to use these parameters, please see the [Guide to Data APIs](https://docs.fylehq.com/docs/fyle-platform-docs/ZG9jOjI3Mzk2NTM3-guide-to-data-ap-is#filtering) + operationId: corporate_cards_list + parameters: + - $ref: '../../components/parameters/q.yaml' + - $ref: '../../components/parameters/created_at.yaml' + - $ref: '../../components/parameters/updated_at.yaml' + - $ref: '../../components/parameters/order.yaml' + - $ref: '../../components/parameters/offset.yaml' + - $ref: '../../components/parameters/limit.yaml' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + $ref: '../../components/schemas/count.yaml' + offset: + $ref: '../../components/schemas/offset.yaml' + data: + type: array + items: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/approver/paths/approver@cost_centers.yaml b/src/approver/paths/approver@cost_centers.yaml index 48bbc25df..c3b0de09d 100644 --- a/src/approver/paths/approver@cost_centers.yaml +++ b/src/approver/paths/approver@cost_centers.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/approver/paths/approver@employee_overview.yaml b/src/approver/paths/approver@employee_overview.yaml index b1bcb6232..d5d07d60f 100644 --- a/src/approver/paths/approver@employee_overview.yaml +++ b/src/approver/paths/approver@employee_overview.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: data: type: array diff --git a/src/approver/paths/approver@employee_overview@expenses.yaml b/src/approver/paths/approver@employee_overview@expenses.yaml index a32237d62..e6f26cc27 100644 --- a/src/approver/paths/approver@employee_overview@expenses.yaml +++ b/src/approver/paths/approver@employee_overview@expenses.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/approver/paths/approver@employee_overview@expenses@stats.yaml b/src/approver/paths/approver@employee_overview@expenses@stats.yaml index b9f4a4e48..cee6c869e 100644 --- a/src/approver/paths/approver@employee_overview@expenses@stats.yaml +++ b/src/approver/paths/approver@employee_overview@expenses@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/employee.yaml#/employee_overview_expense_stats_out diff --git a/src/approver/paths/approver@employee_overview@hierarchy.yaml b/src/approver/paths/approver@employee_overview@hierarchy.yaml index cd75505f9..36c9960c5 100644 --- a/src/approver/paths/approver@employee_overview@hierarchy.yaml +++ b/src/approver/paths/approver@employee_overview@hierarchy.yaml @@ -12,6 +12,8 @@ get: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@employee_overview@stats.yaml b/src/approver/paths/approver@employee_overview@stats.yaml index b133e3fc7..441c9a55d 100644 --- a/src/approver/paths/approver@employee_overview@stats.yaml +++ b/src/approver/paths/approver@employee_overview@stats.yaml @@ -32,6 +32,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: ../../components/schemas/employee.yaml#/employee_overview_stats_out diff --git a/src/approver/paths/approver@employees.yaml b/src/approver/paths/approver@employees.yaml index bcee0bebf..89317e6d0 100644 --- a/src/approver/paths/approver@employees.yaml +++ b/src/approver/paths/approver@employees.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/approver/paths/approver@expense_fields.yaml b/src/approver/paths/approver@expense_fields.yaml index e64e0c2bb..fdb1a626c 100644 --- a/src/approver/paths/approver@expense_fields.yaml +++ b/src/approver/paths/approver@expense_fields.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/approver/paths/approver@expense_policies@states.yaml b/src/approver/paths/approver@expense_policies@states.yaml index 9316b6a4e..2bd6f130f 100644 --- a/src/approver/paths/approver@expense_policies@states.yaml +++ b/src/approver/paths/approver@expense_policies@states.yaml @@ -29,6 +29,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/approver/paths/approver@expenses.yaml b/src/approver/paths/approver@expenses.yaml index c30adfef7..2537789d4 100644 --- a/src/approver/paths/approver@expenses.yaml +++ b/src/approver/paths/approver@expenses.yaml @@ -14,6 +14,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -49,6 +53,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/approver_expense_in' @@ -59,6 +65,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_out' diff --git a/src/approver/paths/approver@expenses@attach_files@bulk.yaml b/src/approver/paths/approver@expenses@attach_files@bulk.yaml index 697d8e58d..10a43e46a 100644 --- a/src/approver/paths/approver@expenses@attach_files@bulk.yaml +++ b/src/approver/paths/approver@expenses@attach_files@bulk.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@expenses@bulk.yaml b/src/approver/paths/approver@expenses@bulk.yaml new file mode 100644 index 000000000..d9f30d26d --- /dev/null +++ b/src/approver/paths/approver@expenses@bulk.yaml @@ -0,0 +1,56 @@ +post: + tags: + - Expenses + summary: Update expenses in bulk + description: | + Update expenses in bulk by approver. + operationId: approver_expenses_post_bulk + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '../../components/schemas/expense.yaml#/approver_expenses_bulk_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '../../components/schemas/expense.yaml#/expense_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' \ No newline at end of file diff --git a/src/approver/paths/approver@expenses@check_mandatory_fields_bulk.yaml b/src/approver/paths/approver@expenses@check_mandatory_fields_bulk.yaml new file mode 100644 index 000000000..234574023 --- /dev/null +++ b/src/approver/paths/approver@expenses@check_mandatory_fields_bulk.yaml @@ -0,0 +1,57 @@ +post: + tags: + - Expenses + summary: Check multiple expenses for missing mandatory fields in bulk + description: | + Before updating multiple expense objects as an approver, you can validate + if all mandatory fields are present using this bulk endpoint. + operationId: approver_check_mandatory_fields_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: '../../components/schemas/expense.yaml#/approver_expense_check_mandatory_fields_bulk_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: ../../components/schemas/expense.yaml#/expense_check_mandatory_fields_bulk_out + '401': + description: Unauthorised request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '../../components/schemas/404.yaml' \ No newline at end of file diff --git a/src/approver/paths/approver@expenses@check_policies_bulk.yaml b/src/approver/paths/approver@expenses@check_policies_bulk.yaml new file mode 100644 index 000000000..9d66fc8ab --- /dev/null +++ b/src/approver/paths/approver@expenses@check_policies_bulk.yaml @@ -0,0 +1,53 @@ +post: + tags: + - Expenses + summary: Check multiple expenses for policy violations in bulk + description: | + Approver bulk version of the check_policies API that allows checking + multiple expenses for policy violations in one request. + + **NOTE:** This API can only be used to check policies for existing expenses that you want to update. The API will evaluate all the expenses against the configured policy rules and return an array of policy violation information for each expense in the request payload. + operationId: approver_check_policies_bulk_post + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: "../../components/schemas/expense.yaml#/approver_check_policies_bulk_in" + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: ../../components/schemas/expense.yaml#/expense_check_policies_bulk_out + "401": + description: Unauthorised request + content: + application/json: + schema: + $ref: "../../components/schemas/401.yaml" + "400": + description: Bad request + content: + application/json: + schema: + $ref: "../../components/schemas/400.yaml" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "../../components/schemas/404.yaml" \ No newline at end of file diff --git a/src/approver/paths/approver@expenses@comments.yaml b/src/approver/paths/approver@expenses@comments.yaml index 3231c3d8a..ff96ac90f 100644 --- a/src/approver/paths/approver@expenses@comments.yaml +++ b/src/approver/paths/approver@expenses@comments.yaml @@ -13,6 +13,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/approver/paths/approver@expenses@comments@bulk.yaml b/src/approver/paths/approver@expenses@comments@bulk.yaml index 2fb188a45..8ba2a5104 100644 --- a/src/approver/paths/approver@expenses@comments@bulk.yaml +++ b/src/approver/paths/approver@expenses@comments@bulk.yaml @@ -13,6 +13,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_comments_bulk_in' @@ -23,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@expenses@duplicate_sets.yaml b/src/approver/paths/approver@expenses@duplicate_sets.yaml index f8f622c84..417a4ac2d 100644 --- a/src/approver/paths/approver@expenses@duplicate_sets.yaml +++ b/src/approver/paths/approver@expenses@duplicate_sets.yaml @@ -21,6 +21,8 @@ get: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@expenses@export_configurations.yaml b/src/approver/paths/approver@expenses@export_configurations.yaml index db5801239..4d56b4cab 100644 --- a/src/approver/paths/approver@expenses@export_configurations.yaml +++ b/src/approver/paths/approver@expenses@export_configurations.yaml @@ -17,6 +17,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -154,6 +158,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expenses_export_configurations.yaml#/expenses_export_configuration_out' diff --git a/src/approver/paths/approver@expenses@exports.yaml b/src/approver/paths/approver@expenses@exports.yaml index 0736bd382..1e0d8906e 100644 --- a/src/approver/paths/approver@expenses@exports.yaml +++ b/src/approver/paths/approver@expenses@exports.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expenses_exports.yaml#/expenses_exports_out' diff --git a/src/approver/paths/approver@expenses@filters.yaml b/src/approver/paths/approver@expenses@filters.yaml index b81a049cd..38291520a 100644 --- a/src/approver/paths/approver@expenses@filters.yaml +++ b/src/approver/paths/approver@expenses@filters.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense_filters.yaml#/expense_filters_out' @@ -59,6 +61,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/approver/paths/approver@expenses@filters@delete.yaml b/src/approver/paths/approver@expenses@filters@delete.yaml index 144f8b063..0acdb816f 100644 --- a/src/approver/paths/approver@expenses@filters@delete.yaml +++ b/src/approver/paths/approver@expenses@filters@delete.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense_filters.yaml#/expense_filters_out' diff --git a/src/approver/paths/approver@expenses@permissions.yaml b/src/approver/paths/approver@expenses@permissions.yaml index 00ba5862c..e291a4a40 100644 --- a/src/approver/paths/approver@expenses@permissions.yaml +++ b/src/approver/paths/approver@expenses@permissions.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_permissions_out' diff --git a/src/approver/paths/approver@expenses@permissions@bulk.yaml b/src/approver/paths/approver@expenses@permissions@bulk.yaml index 2ffce10c5..938f1be3c 100644 --- a/src/approver/paths/approver@expenses@permissions@bulk.yaml +++ b/src/approver/paths/approver@expenses@permissions@bulk.yaml @@ -33,6 +33,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_permissions_bulk_out' diff --git a/src/approver/paths/approver@expenses@split.yaml b/src/approver/paths/approver@expenses@split.yaml index 6c18eb6ec..e8a734bc7 100644 --- a/src/approver/paths/approver@expenses@split.yaml +++ b/src/approver/paths/approver@expenses@split.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/admin_split_expense_in' @@ -21,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@expenses@split@check_mandatory_fields.yaml b/src/approver/paths/approver@expenses@split@check_mandatory_fields.yaml index 9a9988de2..57c713302 100644 --- a/src/approver/paths/approver@expenses@split@check_mandatory_fields.yaml +++ b/src/approver/paths/approver@expenses@split@check_mandatory_fields.yaml @@ -13,6 +13,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/admin_split_expense_in' @@ -23,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@expenses@split@check_policies.yaml b/src/approver/paths/approver@expenses@split@check_policies.yaml index 402c93873..f75995482 100644 --- a/src/approver/paths/approver@expenses@split@check_policies.yaml +++ b/src/approver/paths/approver@expenses@split@check_policies.yaml @@ -14,6 +14,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/admin_split_expense_in' @@ -24,6 +26,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@expenses@stats.yaml b/src/approver/paths/approver@expenses@stats.yaml index ee129cee4..0bf898b7c 100644 --- a/src/approver/paths/approver@expenses@stats.yaml +++ b/src/approver/paths/approver@expenses@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expenses_stats_out' diff --git a/src/approver/paths/approver@files@bulk.yaml b/src/approver/paths/approver@files@bulk.yaml index 11b97415d..942bbd084 100644 --- a/src/approver/paths/approver@files@bulk.yaml +++ b/src/approver/paths/approver@files@bulk.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@files@generate_urls@bulk.yaml b/src/approver/paths/approver@files@generate_urls@bulk.yaml index a29425341..f28de9259 100644 --- a/src/approver/paths/approver@files@generate_urls@bulk.yaml +++ b/src/approver/paths/approver@files@generate_urls@bulk.yaml @@ -32,6 +32,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/approver/paths/approver@merchants.yaml b/src/approver/paths/approver@merchants.yaml index 6d38fdc61..cfaa7648c 100644 --- a/src/approver/paths/approver@merchants.yaml +++ b/src/approver/paths/approver@merchants.yaml @@ -19,6 +19,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/approver/paths/approver@mileage_rates.yaml b/src/approver/paths/approver@mileage_rates.yaml index 142a3d7e3..440abc29e 100644 --- a/src/approver/paths/approver@mileage_rates.yaml +++ b/src/approver/paths/approver@mileage_rates.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -32,4 +36,4 @@ get: content: application/json: schema: - $ref: ../../components/schemas/401.yaml \ No newline at end of file + $ref: ../../components/schemas/401.yaml diff --git a/src/approver/paths/approver@per_diem_rates.yaml b/src/approver/paths/approver@per_diem_rates.yaml index b537c1091..f51a54996 100644 --- a/src/approver/paths/approver@per_diem_rates.yaml +++ b/src/approver/paths/approver@per_diem_rates.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/approver/paths/approver@projects.yaml b/src/approver/paths/approver@projects.yaml index ca527ce3a..3bdcf5eaf 100644 --- a/src/approver/paths/approver@projects.yaml +++ b/src/approver/paths/approver@projects.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/approver/paths/approver@reports.yaml b/src/approver/paths/approver@reports.yaml index 995ae8cff..3b9a5df34 100644 --- a/src/approver/paths/approver@reports.yaml +++ b/src/approver/paths/approver@reports.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/approver/paths/approver@reports@add_approver.yaml b/src/approver/paths/approver@reports@add_approver.yaml index 2d728ead7..c2451a2f6 100644 --- a/src/approver/paths/approver@reports@add_approver.yaml +++ b/src/approver/paths/approver@reports@add_approver.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/approver/paths/approver@reports@add_expenses.yaml b/src/approver/paths/approver@reports@add_expenses.yaml index d78c9af28..3aca97649 100644 --- a/src/approver/paths/approver@reports@add_expenses.yaml +++ b/src/approver/paths/approver@reports@add_expenses.yaml @@ -26,6 +26,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/approver/paths/approver@reports@comments.yaml b/src/approver/paths/approver@reports@comments.yaml index 883b28497..7e3628021 100644 --- a/src/approver/paths/approver@reports@comments.yaml +++ b/src/approver/paths/approver@reports@comments.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_comments_out' diff --git a/src/approver/paths/approver@reports@eject_expenses.yaml b/src/approver/paths/approver@reports@eject_expenses.yaml index f948a3806..4e90d7e8b 100644 --- a/src/approver/paths/approver@reports@eject_expenses.yaml +++ b/src/approver/paths/approver@reports@eject_expenses.yaml @@ -26,6 +26,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/approver/paths/approver@reports@export_configurations.yaml b/src/approver/paths/approver@reports@export_configurations.yaml index eebf14228..0eaf70cac 100644 --- a/src/approver/paths/approver@reports@export_configurations.yaml +++ b/src/approver/paths/approver@reports@export_configurations.yaml @@ -17,6 +17,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -79,6 +83,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/reports_export_configurations.yaml#/reports_export_configuration_out' diff --git a/src/approver/paths/approver@reports@exports.yaml b/src/approver/paths/approver@reports@exports.yaml index 4ed93d118..248ff4d59 100644 --- a/src/approver/paths/approver@reports@exports.yaml +++ b/src/approver/paths/approver@reports@exports.yaml @@ -11,6 +11,11 @@ get: content: application/json: schema: + type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -58,6 +63,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/reports_exports.yaml#/reports_exports_out' diff --git a/src/approver/paths/approver@reports@filters.yaml b/src/approver/paths/approver@reports@filters.yaml index 667b4a402..3793210ec 100644 --- a/src/approver/paths/approver@reports@filters.yaml +++ b/src/approver/paths/approver@reports@filters.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/report_filters.yaml#/report_filters_out' @@ -59,6 +61,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: data: type: array diff --git a/src/approver/paths/approver@reports@filters@delete.yaml b/src/approver/paths/approver@reports@filters@delete.yaml index 50d56712a..63bceca83 100644 --- a/src/approver/paths/approver@reports@filters@delete.yaml +++ b/src/approver/paths/approver@reports@filters@delete.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/report_filters.yaml#/report_filters_out' diff --git a/src/approver/paths/approver@reports@partially_approve.yaml b/src/approver/paths/approver@reports@partially_approve.yaml index d4992f6b4..63e0f396e 100644 --- a/src/approver/paths/approver@reports@partially_approve.yaml +++ b/src/approver/paths/approver@reports@partially_approve.yaml @@ -26,6 +26,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/approver/paths/approver@reports@permissions.yaml b/src/approver/paths/approver@reports@permissions.yaml index 00c0674d9..71ca3ad25 100644 --- a/src/approver/paths/approver@reports@permissions.yaml +++ b/src/approver/paths/approver@reports@permissions.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report_permissions.yaml#/report_permissions_out' diff --git a/src/approver/paths/approver@reports@round_off_amount.yaml b/src/approver/paths/approver@reports@round_off_amount.yaml index 97134cb22..67b43e94c 100644 --- a/src/approver/paths/approver@reports@round_off_amount.yaml +++ b/src/approver/paths/approver@reports@round_off_amount.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/approver/paths/approver@reports@send_back.yaml b/src/approver/paths/approver@reports@send_back.yaml index 097602105..8502b3c9b 100644 --- a/src/approver/paths/approver@reports@send_back.yaml +++ b/src/approver/paths/approver@reports@send_back.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/approver/paths/approver@reports@stats.yaml b/src/approver/paths/approver@reports@stats.yaml index bd00c4e13..029c82d13 100644 --- a/src/approver/paths/approver@reports@stats.yaml +++ b/src/approver/paths/approver@reports@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/reports_stats_out' diff --git a/src/approver/paths/approver@subscriptions.yaml b/src/approver/paths/approver@subscriptions.yaml index d4810d5c1..1cece38ec 100644 --- a/src/approver/paths/approver@subscriptions.yaml +++ b/src/approver/paths/approver@subscriptions.yaml @@ -11,6 +11,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/subscriptions.yaml#/subscriptions_in' @@ -22,6 +24,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/subscriptions.yaml#/approver_subscriptions_out' @@ -79,6 +83,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/authorization/openapi.yaml b/src/authorization/openapi.yaml index 1e6d58393..2f4dd63ac 100644 --- a/src/authorization/openapi.yaml +++ b/src/authorization/openapi.yaml @@ -18,7 +18,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' diff --git a/src/common/openapi.yaml b/src/common/openapi.yaml index e2ee5a21f..c766f2ecc 100644 --- a/src/common/openapi.yaml +++ b/src/common/openapi.yaml @@ -18,7 +18,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' @@ -27,6 +27,9 @@ tags: - name: Currencies description: | These APIs gives you list of currencies supported by Sage Exp Mgmt and their exchange rates. + - name: Miscellaneous + description: | + General common operations. # - name: Data Extraction # description: | # These APIs gives the expense relevant data from the reciepts. @@ -35,6 +38,8 @@ tags: These APIs gives the places suggestions and geographic data of a place. paths: + /common/dummy: + $ref: 'paths/common@dummy.yaml' /common/places/autocomplete: $ref: 'paths/common@places@autocomplete.yaml' /common/places: diff --git a/src/common/paths/common@currencies.yaml b/src/common/paths/common@currencies.yaml index e2c63038e..76e8ec61c 100644 --- a/src/common/paths/common@currencies.yaml +++ b/src/common/paths/common@currencies.yaml @@ -10,6 +10,8 @@ get: application/json: schema: type: object + required: + - data properties: data: type: object diff --git a/src/common/paths/common@currencies@exchange_rate.yaml b/src/common/paths/common@currencies@exchange_rate.yaml index de7901e04..bc10b883c 100644 --- a/src/common/paths/common@currencies@exchange_rate.yaml +++ b/src/common/paths/common@currencies@exchange_rate.yaml @@ -31,6 +31,8 @@ get: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/currency.yaml#/exchange_rate_out' diff --git a/src/common/paths/common@dummy.yaml b/src/common/paths/common@dummy.yaml new file mode 100644 index 000000000..5ad9e4e96 --- /dev/null +++ b/src/common/paths/common@dummy.yaml @@ -0,0 +1,25 @@ +get: + tags: + - Miscellaneous + security: [] + x-internal: true + summary: Get dummy data + description: | + Returns a dummy response. + operationId: common_dummy_get + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + type: object + additionalProperties: false + '404': + description: Resource not found diff --git a/src/common/paths/common@org_settings@org_logo_settings@generate_download_url.yaml b/src/common/paths/common@org_settings@org_logo_settings@generate_download_url.yaml index ef3d14d3d..476aea906 100644 --- a/src/common/paths/common@org_settings@org_logo_settings@generate_download_url.yaml +++ b/src/common/paths/common@org_settings@org_logo_settings@generate_download_url.yaml @@ -12,6 +12,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: ../../components/schemas/org_settings.yaml#/logo_file_generate_download_url_action_out diff --git a/src/common/paths/common@places.yaml b/src/common/paths/common@places.yaml index 35c5e8dae..181ef2ae7 100644 --- a/src/common/paths/common@places.yaml +++ b/src/common/paths/common@places.yaml @@ -19,6 +19,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/common/paths/common@places@autocomplete.yaml b/src/common/paths/common@places@autocomplete.yaml index 26e502973..0b7aa0a92 100644 --- a/src/common/paths/common@places@autocomplete.yaml +++ b/src/common/paths/common@places@autocomplete.yaml @@ -55,6 +55,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/components/schemas/account.yaml b/src/components/schemas/account.yaml index 8673451d1..82b9bf642 100644 --- a/src/components/schemas/account.yaml +++ b/src/components/schemas/account.yaml @@ -1,6 +1,17 @@ account_out: type: object additionalProperties: false + required: + - id + - created_at + - updated_at + - user_id + - type + - currency + - current_balance_amount + - tentative_balance_amount + - org_id + - category_id properties: id: allOf: @@ -45,6 +56,9 @@ account_out: account_out_embed: type: object + required: + - id + - type properties: id: allOf: @@ -63,6 +77,11 @@ account_out_embed: account_snapshot_out_embed: type: object + required: + - account_id + - type + - currency + - balance properties: account_id: allOf: @@ -87,6 +106,10 @@ account_snapshot_out_embed: account_in: type: object additionalProperties: false + required: + - user_id + - type + - currency properties: user_id: type: string diff --git a/src/components/schemas/accounting_export.yaml b/src/components/schemas/accounting_export.yaml index 88f59fd72..2d5af49f3 100644 --- a/src/components/schemas/accounting_export.yaml +++ b/src/components/schemas/accounting_export.yaml @@ -1,6 +1,17 @@ accounting_export_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - file_ids + - exported_at + - description + - url + - client_id properties: id: allOf: diff --git a/src/components/schemas/accounting_export_lineitem.yaml b/src/components/schemas/accounting_export_lineitem.yaml index 72b43a549..ffb232950 100644 --- a/src/components/schemas/accounting_export_lineitem.yaml +++ b/src/components/schemas/accounting_export_lineitem.yaml @@ -1,6 +1,15 @@ accounting_export_lineitem_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - object_id + - object_type + - reference + - accounting_export_id properties: id: $ref: './fields.yaml#/id_string' diff --git a/src/components/schemas/advance.yaml b/src/components/schemas/advance.yaml index 982fcd3dc..0daadea92 100644 --- a/src/components/schemas/advance.yaml +++ b/src/components/schemas/advance.yaml @@ -1,6 +1,36 @@ advance_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - advance_request_id + - user_id + - org_id + - project_id + - seq_num + - amount + - issued_at + - card_number + - currency + - custom_fields + - foreign_amount + - foreign_currency + - payment_mode + - purpose + - code + - source + - advance_account_id + - advance_wallet_id + - is_exported + - last_exported_at + - user + - project + - employee_id + - employee + - creator_user + - advance_request properties: id: allOf: @@ -111,6 +141,12 @@ advance_out: advance_out_embed: type: object nullable: true + required: + - id + - currency + - amount + - advance_request_id + - seq_num properties: id: type: string @@ -143,6 +179,14 @@ advance_in: - currency - amount - payment_mode + - advance_request_id + - project_id + - card_number + - custom_fields + - foreign_amount + - foreign_currency + - purpose + - code properties: user_id: type: string @@ -208,6 +252,8 @@ advance_in: $ref: './fields.yaml#/custom_fields' advances_stats_in: + required: + - query_params properties: query_params: type: string @@ -218,6 +264,9 @@ advances_stats_in: advances_stats_out: type: object + required: + - count + - total_amount properties: count: type: integer diff --git a/src/components/schemas/advance_refund.yaml b/src/components/schemas/advance_refund.yaml index 7dbcf1dca..849939512 100644 --- a/src/components/schemas/advance_refund.yaml +++ b/src/components/schemas/advance_refund.yaml @@ -1,6 +1,26 @@ advance_refund_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - collector_user_id + - refunded_at + - currency + - amount + - foreign_currency + - foreign_amount + - payment_mode + - code + - notes + - source + - card_number + - advance_wallet_id + - employee_id + - employee properties: created_at: $ref: './fields.yaml#/created_at' @@ -133,6 +153,8 @@ advance_refund_in: example: 'awfgRr8YA6KK' advance_refunds_stats_in: + required: + - query_params properties: query_params: type: string @@ -143,6 +165,9 @@ advance_refunds_stats_in: advance_refunds_stats_out: type: object + required: + - count + - total_amount properties: count: type: integer diff --git a/src/components/schemas/advance_request.yaml b/src/components/schemas/advance_request.yaml index e70235364..42f246f1c 100644 --- a/src/components/schemas/advance_request.yaml +++ b/src/components/schemas/advance_request.yaml @@ -1,6 +1,34 @@ advance_request_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - user_id + - org_id + - project_id + - advance_id + - seq_num + - currency + - amount + - last_approved_at + - notes + - purpose + - source + - state + - custom_fields + - user + - project + - advance + - approvals + - is_exported + - employee_id + - employee + - code + - comments + - file_ids + - files properties: id: allOf: @@ -99,7 +127,7 @@ advance_request_out: comments: type: array items: - $ref: '#/advance_request_comments_out' + $ref: '#/advance_request_comments_out_embed' description: | List of comments in the advance request file_ids: @@ -113,7 +141,7 @@ advance_request_out: items: $ref: './file.yaml#/file_out_embed' -advance_request_in: +advance_request_in_base: type: object properties: id: @@ -125,7 +153,7 @@ advance_request_in: amount: $ref: './fields.yaml#/amount' code: - $ref: ./fields.yaml#/code + $ref: './fields.yaml#/code' notes: type: string nullable: true @@ -152,6 +180,29 @@ advance_request_in: custom_fields: $ref: '#/advance_request_custom_fields' +admin_advance_request_in: + allOf: + - $ref: '#/advance_request_in_base' + - type: object + required: + - id + +advance_request_submit_in: + allOf: + - $ref: '#/advance_request_in_base' + - type: object + required: + - currency + - amount + +spender_advance_request_in: + allOf: + - $ref: '#/advance_request_in_base' + - type: object + required: + - currency + - amount + advance_request_action_in: type: object additionalProperties: False @@ -165,6 +216,8 @@ advance_request_action_in: example: 'rpa21A2rdj2' advance_requests_stats_in: + required: + - query_params properties: query_params: description: | @@ -254,6 +307,10 @@ advance_requests_stats_out: advance_request_out_embed: type: object nullable: true + required: + - id + - last_approved_at + - seq_num properties: id: type: string @@ -277,6 +334,8 @@ advance_request_out_embed: example: 'AR/2020/10/T/95' advance_requests_approver_stats_in: + required: + - query_params properties: query_params: description: | @@ -350,9 +409,52 @@ advance_request_comments_in: description: Comment text to be added to the advance request example: test +advance_request_comments_out_embed: + type: object + additionalProperties: false + required: + - id + - comment + - creator_type + - creator_user_id + - creator_user + - created_at + properties: + id: + $ref: './fields.yaml#/id_string' + comment: + type: string + description: A comment on the advance request + example: Advance request was created + creator_type: + type: string + description: Describes whether the comment is system-generated or User made. + enum: + - SYSTEM + - POLICY + - USER + example: USER + creator_user_id: + $ref: './fields.yaml#/user_id_nullable' + creator_user: + $ref: './user.yaml#/user_out_embed_nullable' + created_at: + $ref: './fields.yaml#/created_at' + advance_request_comments_out: type: object additionalProperties: false + required: + - id + - comment + - action + - advance_request_id + - creator_type + - creator_user_id + - creator_user + - created_at + - updated_at + - org_id properties: id: $ref: './fields.yaml#/id_string' @@ -417,6 +519,18 @@ advance_request_permissions_in: advance_request_permissions_out: type: object additionalProperties: false + required: + - can_save + - can_submit + - can_edit + - can_add_approver + - can_disable_approver + - can_reject + - can_approve + - can_inquire + - can_pull_back + - can_pay + - can_delete properties: can_save: type: boolean @@ -480,6 +594,7 @@ advance_request_action_pull_back_in: description: | Comment explaining the reason for pulling back the advance request example: 'sending back' + nullable: true advance_request_delete_in: type: object @@ -497,7 +612,6 @@ advance_request_add_approver_in: required: - id - approver_email - - comment properties: id: $ref: './fields.yaml#/id_string' @@ -627,6 +741,17 @@ advance_request_custom_field_in: advance_request_custom_field_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - type + - options + - is_mandatory + - is_enabled + - placeholder properties: id: type: integer @@ -688,6 +813,11 @@ advance_request_custom_field: type: object description: | Advance request custom field + required: + - id + - name + - type + - value properties: name: type: string @@ -749,4 +879,4 @@ advance_request_generate_file_urls_in: $ref: './fields.yaml#/id_string' description: List of file IDs to generate URLs for example: - - fiH717IpzaTG \ No newline at end of file + - fiH717IpzaTG diff --git a/src/components/schemas/advance_request_approval.yaml b/src/components/schemas/advance_request_approval.yaml index d4e5b3d1c..d773cf1ea 100644 --- a/src/components/schemas/advance_request_approval.yaml +++ b/src/components/schemas/advance_request_approval.yaml @@ -1,6 +1,10 @@ advance_request_approval_out_embed: type: object additionalProperties: False + required: + - approver_user_id + - approver_user + - state properties: approver_user_id: allOf: diff --git a/src/components/schemas/advance_wallet.yaml b/src/components/schemas/advance_wallet.yaml index 8ac7f6865..30ed9452d 100644 --- a/src/components/schemas/advance_wallet.yaml +++ b/src/components/schemas/advance_wallet.yaml @@ -1,6 +1,14 @@ advance_wallet_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - currency + - balance_amount properties: id: allOf: @@ -33,6 +41,9 @@ advance_wallet_in: advance_wallet_report_out: type: object additionalProperties: false + required: + - id + - amount properties: id: allOf: diff --git a/src/components/schemas/budget.yaml b/src/components/schemas/budget.yaml index e18db2ff9..3e6eb59c8 100644 --- a/src/components/schemas/budget.yaml +++ b/src/components/schemas/budget.yaml @@ -6,7 +6,6 @@ budget_in: - type - observer_ids - amount_limit - - fiscal_year_start_month - department_ids - project_ids - cost_center_ids @@ -65,21 +64,31 @@ budget_in: $ref: './fields.yaml#/id_string' example: - usge49ielgel - fiscal_year_start_month: - type: number - example: 10 - description: Month number of start of fisical year - minimum: 1 - maximum: 12 visibility: $ref: ./fields.yaml#/budget_visibility user_ids: $ref: ./fields.yaml#/budget_user_ids -budget_out: +budget_post_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - alert_threshold + - is_enabled + - type + - amount_limit + - observer_ids + - project_ids + - cost_center_ids + - category_ids + - department_ids + - visibility properties: id: $ref: './fields.yaml#/id_string' @@ -137,12 +146,93 @@ budget_out: $ref: './fields.yaml#/id_string' example: - usge49ielgel - fiscal_year_start_month: + visibility: + $ref: ./fields.yaml#/budget_visibility + +budget_out: + type: object + additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - alert_threshold + - is_enabled + - type + - amount_limit + - observer_ids + - project_ids + - cost_center_ids + - category_ids + - department_ids + - budget_start_date + - budget_end_date + - amount_spent + - amount_remaining + - utilisation_percentage + - budget_creator + - visibility + - status + - user_ids + properties: + id: + $ref: './fields.yaml#/id_string' + org_id: + $ref: ./fields.yaml#/org_id + created_at: + $ref: ./fields.yaml#/created_at + updated_at: + $ref: ./fields.yaml#/updated_at + is_enabled: + $ref: ./fields.yaml#/is_enabled + name: + allOf: + - $ref: ./fields.yaml#/name + example: Sales + type: + $ref: ./fields.yaml#/budget_type + amount_limit: + $ref: './fields.yaml#/amount' + alert_threshold: + nullable: true type: number - example: 10 - description: Month number of start of fiscal year - minimum: 1 - maximum: 12 + example: 5000 + department_ids: + type: array + items: + $ref: './fields.yaml#/id_string' + example: [2222, 1221] + description: | + List of department ids + project_ids: + type: array + items: + $ref: './fields.yaml#/id_integer' + example: [2222, 1221] + description: | + List of project ids + cost_center_ids: + type: array + items: + $ref: './fields.yaml#/id_integer' + example: [2222, 1221] + description: | + List of cost center ids + category_ids: + type: array + items: + $ref: './fields.yaml#/id_integer' + example: [2222, 1221] + description: | + List of category ids + observer_ids: + type: array + items: + $ref: './fields.yaml#/id_string' + example: + - usge49ielgel budget_start_date: type: string nullable: true @@ -185,10 +275,26 @@ budget_out: description: Utilisation percentage of the budget interval visibility: $ref: ./fields.yaml#/budget_visibility + status: + $ref: ./fields.yaml#/budget_status + user_ids: + type: array + items: + $ref: './fields.yaml#/id_string' + example: + - usge49ielgel + description: | + List of user ids budget_out_embed: type: object additionalProperties: False + required: + - id + - name + - type + - amount_limit + - is_enabled properties: id: $ref: './fields.yaml#/id_string' @@ -203,4 +309,57 @@ budget_out_embed: - $ref: './fields.yaml#/amount' example: 10000 is_enabled: - $ref: ./fields.yaml#/is_enabled \ No newline at end of file + $ref: ./fields.yaml#/is_enabled + +spender_budget_out: + type: object + additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - is_enabled + - type + - amount_limit + - amount_spent + - amount_remaining + - utilisation_percentage + - status + properties: + id: + $ref: './fields.yaml#/id_string' + org_id: + $ref: ./fields.yaml#/org_id + created_at: + $ref: ./fields.yaml#/created_at + updated_at: + $ref: ./fields.yaml#/updated_at + is_enabled: + $ref: ./fields.yaml#/is_enabled + name: + allOf: + - $ref: ./fields.yaml#/name + example: Sales + type: + $ref: ./fields.yaml#/budget_type + amount_limit: + $ref: './fields.yaml#/amount' + amount_spent: + type: number + nullable: true + example: 5000 + description: Amount spent from the budget interval + amount_remaining: + type: number + nullable: true + example: 5000 + description: Amount remaining in the budget interval + utilisation_percentage: + type: number + nullable: true + example: 50 + description: Utilisation percentage of the budget interval + status: + $ref: ./fields.yaml#/budget_status diff --git a/src/components/schemas/budget_exports.yaml b/src/components/schemas/budget_exports.yaml new file mode 100644 index 000000000..4e2f0cca2 --- /dev/null +++ b/src/components/schemas/budget_exports.yaml @@ -0,0 +1,61 @@ +budget_exports_in: + type: object + additionalProperties: false + required: + - query_params + properties: + query_params: + allOf: + - $ref: './fields.yaml#/query_params' + nullable: false + description: | + Query parameters to filter budgets for export. + example: status=eq.Exceeded + + +budget_exports_out: + type: object + additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - file_id + - state + properties: + created_at: + $ref: './fields.yaml#/created_at' + updated_at: + $ref: './fields.yaml#/updated_at' + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: budexpXXXXXXXX + org_id: + $ref: './fields.yaml#/org_id' + user_id: + $ref: './fields.yaml#/user_id' + query_params: + allOf: + - $ref: './fields.yaml#/query_params' + nullable: false + file_id: + anyOf: + - $ref: './fields.yaml#/null_field' + - $ref: './fields.yaml#/id_string' + nullable: true + example: filumWHrlPf7K + state: + type: string + nullable: false + enum: + - PENDING + - PROCESSING + - SUCCESS + - ERROR + description: | + Status of the export. + example: PENDING diff --git a/src/components/schemas/budget_usage.yaml b/src/components/schemas/budget_usage.yaml index 8cf5c0f92..abb343bc5 100644 --- a/src/components/schemas/budget_usage.yaml +++ b/src/components/schemas/budget_usage.yaml @@ -6,6 +6,14 @@ budget_usage_out: - spent - amount_limit - budget + - created_at + - updated_at + - id + - org_id + - start_date + - end_date + - budget_department_ids + - budget_project_ids additionalProperties: False properties: id: diff --git a/src/components/schemas/category.yaml b/src/components/schemas/category.yaml index 3cb48a21c..9fa66ad8c 100644 --- a/src/components/schemas/category.yaml +++ b/src/components/schemas/category.yaml @@ -1,6 +1,18 @@ category_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - display_name + - code + - is_enabled + - name + - sub_category + - system_category + - restricted_project_ids properties: id: $ref: './fields.yaml#/id_integer' @@ -53,6 +65,13 @@ category_out_embed: type: object nullable: true additionalProperties: False + required: + - id + - system_category + - name + - sub_category + - code + - display_name properties: id: $ref: './fields.yaml#/id_integer' @@ -148,6 +167,8 @@ category_in_only_id: system_category_out: type: object additionalProperties: False + required: + - name properties: name: type: string @@ -158,6 +179,19 @@ system_category_out: admin_approver_category_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - display_name + - code + - is_enabled + - name + - sub_category + - system_category + - restricted_project_ids + - restricted_spender_user_ids properties: id: $ref: './fields.yaml#/id_integer' @@ -209,10 +243,15 @@ admin_approver_category_out: category_delete_summary_out: type: object + required: + - data additionalProperties: False properties: data: type: object + required: + - delete_count + - categories properties: delete_count: type: integer diff --git a/src/components/schemas/corporate_card.yaml b/src/components/schemas/corporate_card.yaml index bd41e0ebf..fd6c2d3f4 100644 --- a/src/components/schemas/corporate_card.yaml +++ b/src/components/schemas/corporate_card.yaml @@ -144,6 +144,23 @@ corporate_card_out: description: | Unique nickname assigned to the card example: 'Business Card' + is_archived: + type: boolean + description: | + Indicates whether the corporate card is archived. + nullable: false + archived_at: + allOf: + - $ref: './fields.yaml#/timestamptz_utc' + description: | + Signifies when the card was archived + example: "2022-02-01T07:20:39.207250+00:00" + nullable: true + archived_by_user_id: + type: string + description: | + The unique id of an user who archived the card. + nullable: true total_transactions_count: type: integer nullable: false @@ -183,6 +200,8 @@ corporate_card_out: - virtual_card_id - virtual_card_state - nickname + - archived_at + - archived_by_user_id - total_transactions_count - unassigned_transactions_count corporate_card_in: @@ -416,6 +435,23 @@ corporate_card_unassign_out: description: | Unique nickname assigned to the card example: 'Business Card' + is_archived: + type: boolean + description: | + Indicates whether the corporate card is archived. + nullable: false + archived_at: + allOf: + - $ref: './fields.yaml#/timestamptz_utc' + description: | + Signifies when the card was archived + example: "2022-02-01T07:20:39.207250+00:00" + nullable: true + archived_by_user_id: + type: string + description: | + The unique id of an user who archived the card. + nullable: true total_transactions_count: type: integer nullable: false @@ -455,11 +491,22 @@ corporate_card_unassign_out: - virtual_card_id - virtual_card_state - nickname + - archived_at + - archived_by_user_id - total_transactions_count - unassigned_transactions_count corporate_card_out_embed: type: object additionalProperties: false + required: + - id + - bank_name + - card_number + - nickname + - cardholder_name + - masked_number + - user_full_name + - user_email properties: id: allOf: @@ -509,9 +556,81 @@ corporate_card_out_embed: description: | String denoting the card holder's email example: john.doe@example.com + is_archived: + type: boolean + description: | + Indicates whether the corporate card is archived. + nullable: false + + +duplicate_suggestion_corporate_card_out_embed: + type: object + additionalProperties: false + required: + - id + - bank_name + - card_number + - nickname + - total_transactions_count + - is_visa_enrolled + - is_mastercard_enrolled + - data_feed_source + - feed_display_name + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: bawownwrng + bank_name: + type: string + description: | + Specifies the name of bank who issued the card. + example: Bank of America + card_number: + type: string + description: | + Specifies the masked number of the card. + example: xxxx-4543 + nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: 'Business Card' + total_transactions_count: + type: integer + nullable: false + description: | + The total number of transactions for the card, in Sage Exp Mgmt + example: 100 + is_visa_enrolled: + type: boolean + description: | + If the card is enrolled with real time feed from visa + nullable: false + is_mastercard_enrolled: + type: boolean + description: | + If the card is enrolled with realtime feed from Mastercard + nullable: false + data_feed_source: + type: string + nullable: true + description: | + signifies the source of how card is added and how further card transactions could be synced + example: BANK FEED - CDF + feed_display_name: + type: string + nullable: true + description: | + A user-friendly name for the data feed source. + example: Bank Feed corporate_card_stats_in: + required: + - query_params properties: query_params: nullable: False @@ -522,6 +641,9 @@ corporate_card_stats_in: corporate_card_stats_out: type: object + required: + - count + - transactions_count properties: count: type: integer @@ -632,3 +754,229 @@ yodlee_accounts_out: - yodlee_fastlink_params - created_at - updated_at + - corporate_card_id +corporate_card_merge_in: + type: object + properties: + destination_card_id: + allOf: + - $ref: './fields.yaml#/id_string' + description: | + The ID of the destination card into which the source card will be merged + example: bawownwrng + source_card_id: + allOf: + - $ref: './fields.yaml#/id_string' + description: | + The ID of the source card that will be merged into the destination card + example: uswjwgnwwgo + required: + - destination_card_id + - source_card_id + + +corporate_card_duplicate_suggestion_out: + type: object + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: bawownwrng + org_id: + $ref: './fields.yaml#/org_id' + user_id: + type: string + maxLength: 255 + nullable: true + description: | + The unique id of an user to whom the card is assigned + example: uswjwgnwwgo + user: + $ref: ./user.yaml#/user_out_embed_nullable + created_at: + $ref: './fields.yaml#/created_at' + updated_at: + $ref: './fields.yaml#/updated_at' + destination_card_id: + allOf: + - $ref: './fields.yaml#/id_string' + example: bawownwrng + description: | + The ID of the destination card into which the source card will be merged + destination_card: + $ref: ./corporate_card.yaml#/duplicate_suggestion_corporate_card_out_embed + source_card_id: + allOf: + - $ref: './fields.yaml#/id_string' + example: baccownwrng + description: | + The ID of the source card that will be merged into the destination card + source_card: + $ref: ./corporate_card.yaml#/duplicate_suggestion_corporate_card_out_embed + is_dismissed: + type: boolean + description: | + Indicates whether the duplicate suggestion has been dismissed by an admin + nullable: false + required: + - id + - org_id + - user_id + - user + - created_at + - updated_at + - destination_card_id + - destination_card + - source_card_id + - source_card + - is_dismissed + +corporate_card_duplicate_suggestion_dismiss_in: + type: object + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: ccdswownwrng + description: | + The ID of the duplicate suggestion to be dismissed + required: + - id + +corporate_card_archive_in: + type: object + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: bawownwrng + required: + - id + +corporate_card_unarchive_in: + type: object + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: bawownwrng + required: + - id + +corporate_card_archive_suggestion_out: + type: object + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: bawownwrng + org_id: + $ref: './fields.yaml#/org_id' + user_id: + type: string + maxLength: 255 + nullable: true + description: | + The unique id of an user to whom the card is assigned + example: uswjwgnwwgo + user: + $ref: ./user.yaml#/user_out_embed_nullable + created_at: + $ref: './fields.yaml#/created_at' + updated_at: + $ref: './fields.yaml#/updated_at' + corporate_card_id: + allOf: + - $ref: './fields.yaml#/id_string' + example: bawownwrng + card_number: + type: string + description: | + Specifies the masked number of the card. + example: xxxx-4543 + bank_name: + type: string + description: | + Specifies the name of bank who issued the card. + example: Bank of America + nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: 'Business Card' + data_feed_source: + type: string + nullable: true + description: | + signifies the source of how card is added and how further card transactions could be synced + example: BANK FEED - CDF + is_visa_enrolled: + type: boolean + description: | + If the card is enrolled with real time feed from visa + nullable: false + is_mastercard_enrolled: + type: boolean + description: | + If the card is enrolled with realtime feed from Mastercard + nullable: false + is_dismissed: + type: boolean + description: | + Indicates whether the archive suggestion has been dismissed by an admin + nullable: false + required: + - id + - org_id + - user_id + - user + - created_at + - updated_at + - corporate_card_id + - is_dismissed + - card_number + - bank_name + - nickname + - data_feed_source + - is_visa_enrolled + - is_mastercard_enrolled + + +corporate_card_archive_suggestion_dismiss_in: + type: object + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: ccaswownwrng + description: | + The ID of the archive suggestion to be dismissed + required: + - id + + +corporate_card_rtf_monthly_enrollment_usage_out: + type: object + properties: + monthly_limit: + type: integer + default: 3 + description: | + The monthly limit for the RTF card enrollment usage. + example: 3 + enrolled_cards: + type: integer + description: | + The number of RTF cards enrolled in the current month. + example: 1 + is_limit_reached: + type: boolean + description: | + Indicates whether the monthly limit for RTF card enrollment usage has been reached. + example: false + required: + - monthly_limit + - enrolled_cards + - is_limit_reached diff --git a/src/components/schemas/corporate_card_transaction.yaml b/src/components/schemas/corporate_card_transaction.yaml index 207e0b00f..c0144790a 100644 --- a/src/components/schemas/corporate_card_transaction.yaml +++ b/src/components/schemas/corporate_card_transaction.yaml @@ -309,6 +309,10 @@ corporate_card_transaction_list_out: - last_user_matched_at - is_exported - metadata + - transaction_status + - mcc + - bank_transaction_number + - capitalone_virtual_card_last_four corporate_card_transaction_in: type: object @@ -599,6 +603,7 @@ corporate_card_transaction_post_out: - is_exported - metadata + - mcc corporate_card_transaction_assign_in: type: object properties: @@ -826,6 +831,7 @@ corporate_card_transaction_assign_out: - last_user_matched_at - metadata + - mcc corporate_card_transaction_unassign_out: type: object properties: @@ -1042,6 +1048,8 @@ corporate_card_transaction_unassign_out: - last_user_matched_at - metadata + - mcc + - is_exported corporate_card_transaction_match_in: type: object properties: @@ -1275,6 +1283,9 @@ corporate_card_transaction_match_out: - last_user_matched_at - metadata + - capitalone_virtual_card_last_four + - mcc + - is_exported corporate_card_transaction_unmatch_in: type: object properties: @@ -1520,6 +1531,11 @@ corporate_card_transaction_unmatch_out: - last_user_matched_at - metadata + - transaction_status + - capitalone_virtual_card_last_four + - mcc + - bank_transaction_number + - is_exported corporate_card_transaction_id_in: type: object properties: @@ -1738,6 +1754,8 @@ corporate_card_transaction_mark_personal_out: - last_user_matched_at - metadata + - mcc + - is_exported corporate_card_transaction_unmark_personal_out: type: object properties: @@ -1947,6 +1965,8 @@ corporate_card_transaction_unmark_personal_out: - last_user_matched_at - metadata + - mcc + - is_exported corporate_card_transaction_ignore_out: type: object properties: @@ -2162,6 +2182,9 @@ corporate_card_transaction_ignore_out: - last_user_matched_at - metadata + - capitalone_virtual_card_last_four + - mcc + - is_exported corporate_card_transaction_undo_ignore_out: type: object additionalProperties: false @@ -2392,7 +2415,14 @@ corporate_card_transaction_undo_ignore_out: - last_user_matched_at - metadata + - transaction_status + - capitalone_virtual_card_last_four + - mcc + - bank_transaction_number corporate_card_transactions_stats_in: + type: object + required: + - query_params properties: query_params: nullable: false @@ -2403,6 +2433,10 @@ corporate_card_transactions_stats_in: corporate_card_transactions_stats_out: type: object + required: + - count + - debit_amount + - credit_amount properties: count: type: integer @@ -2435,6 +2469,9 @@ corporate_card_transactions_delete_summary_in: corporate_card_transactions_delete_summary_out: type: object + required: + - delete_count + - delete_amount properties: delete_count: type: integer @@ -2477,6 +2514,8 @@ corporate_card_transaction_reassign_in: corporate_card_transactions_expenses_stats_in: type: object + required: + - query_params properties: query_params: type: string diff --git a/src/components/schemas/corporate_card_transaction_filters.yaml b/src/components/schemas/corporate_card_transaction_filters.yaml index cfbec1ad3..c864516eb 100644 --- a/src/components/schemas/corporate_card_transaction_filters.yaml +++ b/src/components/schemas/corporate_card_transaction_filters.yaml @@ -15,6 +15,15 @@ corporate_card_transaction_filters_in: corporate_card_transaction_filters_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - user_id + - name + - is_shared + - query_string properties: id: allOf: diff --git a/src/components/schemas/corporate_card_transactions_export_configurations.yaml b/src/components/schemas/corporate_card_transactions_export_configurations.yaml index 74a884d12..e08966f4d 100644 --- a/src/components/schemas/corporate_card_transactions_export_configurations.yaml +++ b/src/components/schemas/corporate_card_transactions_export_configurations.yaml @@ -1,5 +1,11 @@ corporate_card_transactions_export_configuration_column: type: object + required: + - name + - formula + - is_custom + - field_name + - formula_text properties: name: type: string @@ -37,6 +43,10 @@ corporate_card_transactions_export_configuration_column: corporate_card_transactions_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -60,6 +70,8 @@ corporate_card_transactions_export_configuration_sort_column: corporate_card_transactions_export_configuration_separate_line_items_entry: type: object + required: + - is_enabled properties: is_enabled: type: boolean @@ -84,6 +96,11 @@ corporate_card_transactions_export_configuration_separate_line_items_entry: corporate_card_transactions_export_configuration_config: type: object + required: + - is_header_visible + - separate_line_items_entry + - columns + - date_format additionalProperties: true properties: is_header_visible: @@ -159,9 +176,9 @@ corporate_card_transactions_export_configuration_in: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature corporate_card_transactions_export_configuration_in_only_id: @@ -177,6 +194,17 @@ corporate_card_transactions_export_configuration_in_only_id: corporate_card_transactions_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: diff --git a/src/components/schemas/corporate_card_transactions_exports.yaml b/src/components/schemas/corporate_card_transactions_exports.yaml index 72cd7ea49..430b52a24 100644 --- a/src/components/schemas/corporate_card_transactions_exports.yaml +++ b/src/components/schemas/corporate_card_transactions_exports.yaml @@ -1,5 +1,8 @@ corporate_card_transactions_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -26,6 +29,11 @@ corporate_card_transactions_export_config_column_formula: corporate_card_transactions_export_config: type: object additionalProperties: true + required: + - type + - is_header_visible + - columns + - separate_line_items_entry properties: type: type: string @@ -42,6 +50,8 @@ corporate_card_transactions_export_config: example: true separate_line_items_entry: type: object + required: + - enabled properties: enabled: type: boolean @@ -68,6 +78,9 @@ corporate_card_transactions_export_config: type: array items: type: object + required: + - name + - formula properties: name: type: string @@ -113,6 +126,20 @@ corporate_card_transactions_exports_in: corporate_card_transactions_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - notify_emails + - config + - file_id + - state + - processed_at + - completed_at + - failed_at properties: created_at: $ref: './fields.yaml#/created_at' diff --git a/src/components/schemas/corporate_credit_card_expense.yaml b/src/components/schemas/corporate_credit_card_expense.yaml index fe5669f3b..d1d152ea3 100644 --- a/src/components/schemas/corporate_credit_card_expense.yaml +++ b/src/components/schemas/corporate_credit_card_expense.yaml @@ -1,5 +1,9 @@ corporate_credit_card_expense_out_embed: type: object + required: + - id + - currency + - amount properties: id: type: string diff --git a/src/components/schemas/cost_center.yaml b/src/components/schemas/cost_center.yaml index b02a31c5a..bf9086733 100644 --- a/src/components/schemas/cost_center.yaml +++ b/src/components/schemas/cost_center.yaml @@ -1,6 +1,15 @@ cost_center_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - is_enabled + - code + - description properties: id: $ref: './fields.yaml#/id_integer' @@ -27,6 +36,10 @@ cost_center_out_embed: type: object nullable: true additionalProperties: False + required: + - id + - name + - code properties: id: $ref: './fields.yaml#/id_integer' @@ -98,6 +111,16 @@ cost_center_in: admin_cost_center_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - is_enabled + - code + - description + - restricted_spender_user_ids properties: id: $ref: './fields.yaml#/id_integer' @@ -125,6 +148,16 @@ admin_cost_center_out: approver_cost_center_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - is_enabled + - code + - description + - restricted_spender_user_ids properties: id: $ref: './fields.yaml#/id_integer' @@ -148,3 +181,34 @@ approver_cost_center_out: $ref: ./fields.yaml#/updated_at restricted_spender_user_ids: $ref: ./fields.yaml#/restricted_spender_user_ids + +cost_center_in_only_id: + type: object + required: + - id + additionalProperties: False + properties: + id: + $ref: './fields.yaml#/id_integer' + +cost_center_delete_summary_out: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: object + properties: + delete_count: + type: integer + description: Count of cost centers that could be deleted from input cost centers. + example: 2 + cost_centers: + type: array + description: Cost centers that could be deleted. + example: + - id: 1234 + - id: 4567 + items: + $ref: './cost_center.yaml#/cost_center_in_only_id' diff --git a/src/components/schemas/currency.yaml b/src/components/schemas/currency.yaml index 365cba351..748254464 100644 --- a/src/components/schemas/currency.yaml +++ b/src/components/schemas/currency.yaml @@ -1,5 +1,7 @@ exchange_rate_out: type: object + required: + - exchange_rate additionalProperties: false properties: exchange_rate: diff --git a/src/components/schemas/department.yaml b/src/components/schemas/department.yaml index 073f289f5..186d566ee 100644 --- a/src/components/schemas/department.yaml +++ b/src/components/schemas/department.yaml @@ -1,6 +1,20 @@ department_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - sub_department + - is_enabled + - code + - description + - department_head_user_ids + - doc_url + - department_head_users + - display_name properties: id: $ref: './fields.yaml#/id_string' @@ -52,6 +66,12 @@ department_out_embed: type: object additionalProperties: False nullable: true + required: + - id + - code + - name + - sub_department + - display_name properties: id: $ref: './fields.yaml#/id_string' @@ -73,6 +93,31 @@ department_out_embed: spaces. In case if no sub_department is present it is same as name of the department. + +department_out_employee_embed: + type: object + additionalProperties: False + nullable: true + required: + - id + - code + - name + - sub_department + properties: + id: + $ref: './fields.yaml#/id_string' + code: + $ref: ./fields.yaml#/code + name: + allOf: + - $ref: ./fields.yaml#/name + example: Sales + sub_department: + type: string + nullable: true + example: Outbound Sales + + department_in: type: object required: @@ -102,4 +147,38 @@ department_in: nullable: true description: | Link to an external document that would be shared with employees - example: https://stoplight.io/ \ No newline at end of file + example: https://stoplight.io/ + + +department_in_only_id: + type: object + required: + - id + additionalProperties: False + properties: + id: + $ref: './fields.yaml#/id_string' + + +department_delete_summary_out: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: object + additionalProperties: False + properties: + delete_count: + type: integer + description: Count of departments that can be deleted from the supplied departments. + example: 2 + departments: + type: array + description: Departments that can be deleted. + example: + - id: deptTqSvgYSlMk + - id: deptISw67iupk3 + items: + $ref: './department.yaml#/department_in_only_id' diff --git a/src/components/schemas/dependent_expense_field_values.yaml b/src/components/schemas/dependent_expense_field_values.yaml index 3aa27fef8..7e9a8ff5c 100644 --- a/src/components/schemas/dependent_expense_field_values.yaml +++ b/src/components/schemas/dependent_expense_field_values.yaml @@ -1,6 +1,16 @@ dependent_expense_field_values_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - parent_expense_field_id + - expense_field_id + - parent_expense_field_value + - expense_field_value + - is_enabled properties: id: $ref: './fields.yaml#/id_integer' @@ -76,6 +86,16 @@ dependent_expense_field_values_in: dependent_expense_field_values_upload_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - parent_expense_field_id + - expense_field_id + - file_id + - error_file_id + - state properties: id: $ref: './fields.yaml#/id_integer' @@ -144,6 +164,12 @@ dependent_expense_field_values_upload_in: dependent_expense_field_values_preview_out: type: object additionalProperties: false + required: + - org_id + - parent_expense_field_id + - expense_field_id + - parent_expense_field_value + - expense_field_values properties: org_id: $ref: ./fields.yaml#/org_id @@ -179,6 +205,15 @@ dependent_expense_field_values_preview_out: dependent_expense_field_values_download_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - parent_expense_field_id + - expense_field_id + - file_id + - state properties: id: $ref: './fields.yaml#/id_integer' diff --git a/src/components/schemas/employee.yaml b/src/components/schemas/employee.yaml index a8f54b335..5b5086d29 100644 --- a/src/components/schemas/employee.yaml +++ b/src/components/schemas/employee.yaml @@ -1,6 +1,48 @@ employee_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - business_unit + - code + - custom_fields + - department + - department_id + - is_enabled + - joined_at + - level + - level_id + - location + - org_id + - roles + - special_email + - title + - user_id + - user + - mileage_rate_ids + - mileage_rates + - cost_center_ids + - cost_centers + - per_diem_rate_ids + - per_diem_rates + - project_ids + - projects + - approver_user_ids + - approver_users + - has_accepted_invite + - branch_account + - branch_ifsc + - mobile + - locale + - mileage_settings + - ach_account + - delegatees + - category_ids + - categories + - flattened_custom_field + - is_mobile_verified properties: id: $ref: './fields.yaml#/id_string' @@ -33,7 +75,7 @@ employee_out: department_id: $ref: './fields.yaml#/fk_string' department: - $ref: './department.yaml#/department_out_embed' + $ref: './department.yaml#/department_out_employee_embed' is_enabled: allOf: - $ref: ./fields.yaml#/is_enabled @@ -232,6 +274,14 @@ employee_out: employee_out_embed: type: object additionalProperties: False + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department properties: id: $ref: ./fields.yaml#/id_string @@ -257,7 +307,7 @@ employee_out_embed: $ref: './fields.yaml#/department_id' department: nullable: True - $ref: './department.yaml#/department_out_embed' + $ref: './department.yaml#/department_out_employee_embed' # level: # $ref: './level.yaml#/level_out_embed' # location: @@ -279,6 +329,11 @@ employee_out_embed: employee_out_potential_duplicate_expenses: type: object additionalProperties: False + required: + - user_id + - email + - full_name + - potential_duplicate_expenses properties: user_id: $ref: './fields.yaml#/user_id' @@ -299,6 +354,115 @@ employee_out_embed_for_expense: type: object additionalProperties: False nullable: True + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department + - location + - title + - business_unit + - custom_fields + - flattened_custom_field + properties: + id: + $ref: ./fields.yaml#/id_string + user_id: + $ref: './fields.yaml#/user_id' + user: + $ref: ./user.yaml#/user_out_embed + code: + type: string + maxLength: 255 + nullable: True + example: E84122 + description: > + This field refers to any string that the client programs can use to refer + to an employee's unique id. + + This could be any field such as an UUID from an Active Directory server or + employee id in a HRMS system. + org_id: + $ref: ./fields.yaml#/org_id + org_name: + $ref: ./fields.yaml#/org_name + department_id: + nullable: True + $ref: './fields.yaml#/department_id' + department: + nullable: True + $ref: './department.yaml#/department_out_embed' + level: + $ref: './level.yaml#/level_out_embed' + location: + type: string + maxLength: 255 + nullable: True + example: Bangalore Ofc + title: + type: string + maxLength: 255 + nullable: True + example: Branch Manager + business_unit: + type: string + maxLength: 255 + nullable: true + example: Finance ops + custom_fields: + type: array + nullable: true + description: | + Custom fields + items: + $ref: './fields.yaml#/custom_field' + flattened_custom_field: + $ref: './fields.yaml#/flattened_custom_field' + has_accepted_invite: + $ref: ./fields.yaml#/has_accepted_invite + is_enabled: + allOf: + - $ref: ./fields.yaml#/is_enabled + description: | + This field indicates whether the employee is enabled in the org. + mobile: + type: string + nullable: True + example: '+12131234567' + items: + $ref: './fields.yaml#/phone_number' + description: | + Mobile number of the employee + joined_at: + $ref: ./fields.yaml#/joined_at + description: | + NOTE: The data of this field is not realtime. It will get updated later even if `employee_id` is already up-to-date. + + +employee_out_embed_for_expense_with_department_name: + type: object + additionalProperties: False + nullable: True + required: + - id + - user_id + - user + - code + - org_id + - org_name + - department_id + - department + - level + - location + - title + - business_unit + - custom_fields + - flattened_custom_field + - has_accepted_invite + - is_enabled properties: id: $ref: ./fields.yaml#/id_string @@ -377,6 +541,18 @@ employee_out_embed_for_expense: employee_out_embed_for_report: type: object additionalProperties: False + required: + - id + - user_id + - user + - code + - org_id + - department_id + - department + - ach_account + - business_unit + - location + - title properties: id: $ref: ./fields.yaml#/id_string @@ -550,6 +726,19 @@ employee_in: spender_employee_out: type: object additionalProperties: False + required: + - id + - user_id + - email + - full_name + - roles + - commute_details + - mobile + - is_mobile_verified + - sms_opt_out_source + - is_enabled + - has_accepted_invite + - delegatees properties: id: $ref: './fields.yaml#/id_string' @@ -619,6 +808,15 @@ employees_upload_in: employees_upload_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - user_id + - org_id + - file_id + - error_file_id + - state properties: id: allOf: @@ -656,6 +854,13 @@ employees_upload_out: employees_download_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - file_id + - state properties: id: allOf: @@ -687,6 +892,19 @@ employees_download_out: spender_commute_details_out: type: object additionalProperties: False + required: + - id + - user_id + - email + - full_name + - roles + - commute_details + - mobile + - is_mobile_verified + - sms_opt_out_source + - is_enabled + - has_accepted_invite + - delegatees properties: id: $ref: './fields.yaml#/id_string' @@ -745,6 +963,10 @@ spender_commute_details_out: spender_delegators_out: type: object additionalProperties: False + required: + - user_id + - email + - full_name properties: user_id: $ref: './fields.yaml#/user_id' @@ -760,6 +982,13 @@ spender_delegators_out: spender_delegatees_delete_out: type: object additionalProperties: False + required: + - id + - org_id + - delegator_user_id + - delegatee_user_id + - start_date + - end_date properties: id: $ref: './fields.yaml#/id_integer' @@ -786,6 +1015,10 @@ spender_delegatees_delete_out: spender_delegatees_post_in: type: object additionalProperties: False + required: + - delegatee_user_id + - start_at + - end_at properties: delegatee_user_id: $ref: ./fields.yaml#/fk_string @@ -801,10 +1034,27 @@ spender_delegatees_post_in: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: True + scopes: + allOf: + - $ref: './fields.yaml#/delegation_access_scope' + nullable: True spender_delegatees_post_out: type: object additionalProperties: False + required: + - id + - user_id + - email + - full_name + - roles + - commute_details + - mobile + - is_mobile_verified + - sms_opt_out_source + - is_enabled + - has_accepted_invite + - delegatees properties: id: $ref: './fields.yaml#/id_string' @@ -863,6 +1113,20 @@ spender_delegatees_post_out: employee_summary_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - user_id + - user + - approver_users + - unreported_expenses_total + - unapproved_reports_total + - reimbursable_amount + - advance_account_ids + - advance_accounts_balance + - liability_amount properties: id: $ref: './fields.yaml#/id_string' @@ -929,6 +1193,12 @@ employee_change_owner_in: employees_send_mobile_verification_code_post_out: type: object + required: + - to + - channel + - status + - date_created + - attempts_left additionalProperties: False properties: to: @@ -946,11 +1216,6 @@ employees_send_mobile_verification_code_post_out: description: | Current status of the verification attempt example: "pending" - valid: - type: boolean - description: | - Whether the verification is valid - example: false date_created: type: string format: date-time @@ -994,6 +1259,15 @@ spender_employee_in: employee_hierarchy_out: type: object additionalProperties: False + required: + - user_id + - org_id + - name + - email + - title + - depth + - has_accepted_invite + - primary_approver_user_id properties: user_id: $ref: './fields.yaml#/user_id' @@ -1027,6 +1301,44 @@ employee_hierarchy_out: spender_employee_current_out: type: object + required: + - id + - org_id + - user_id + - created_at + - updated_at + - user + - code + - joined_at + - title + - business_unit + - special_email + - roles + - location + - is_enabled + - has_accepted_invite + - branch_account + - branch_ifsc + - department_id + - department + - level_id + - level + - mobile + - is_mobile_verified + - mobile_verification_attempts_left + - mobile_verification_attempted_at + - org_name + - currency + - approver_user_ids + - approver_users + - locale + - delegatees + - mileage_settings + - custom_fields + - flattened_custom_field + - commute_details_id + - commute_details + - is_primary additionalProperties: False properties: id: @@ -1103,7 +1415,7 @@ spender_employee_current_out: department_id: $ref: './fields.yaml#/fk_string' department: - $ref: './department.yaml#/department_out_embed' + $ref: './department.yaml#/department_out_employee_embed' level_id: $ref: './fields.yaml#/fk_string' level: @@ -1183,6 +1495,18 @@ spender_employee_current_out: employee_overview_out: type: object additionalProperties: False + required: + - user_id + - org_id + - user + - employee_id + - employee + - primary_approver_id + - primary_approver + - department_id + - department + - expense_total_amount + - expense_count properties: user: type: object @@ -1283,6 +1607,9 @@ employee_overview_out: employee_overview_stats_out: type: object additionalProperties: false + required: + - count + - total_amount properties: count: type: integer @@ -1296,6 +1623,9 @@ employee_overview_stats_out: employee_overview_expense_stats_out: type: object additionalProperties: false + required: + - count + - total_amount properties: count: type: integer @@ -1332,6 +1662,9 @@ employees_stats_out: additionalProperties: false items: type: object + required: + - role + - count additionalProperties: false properties: role: diff --git a/src/components/schemas/employee_account_summary.yaml b/src/components/schemas/employee_account_summary.yaml index a6dfee00f..c994c450a 100644 --- a/src/components/schemas/employee_account_summary.yaml +++ b/src/components/schemas/employee_account_summary.yaml @@ -1,5 +1,23 @@ employee_account_summary_out: type: object + required: + - id + - created_at + - updated_at + - org_id + - org_currency + - user_email + - user_full_name + - cash_account_id + - cash_account + - cash_account_balance + - ccc_account_id + - ccc_account + - ccc_account_balance + - advance_account_ids + - advance_accounts + - advance_accounts_balance + - is_settleable properties: id: diff --git a/src/components/schemas/employee_field.yaml b/src/components/schemas/employee_field.yaml index 2faf10e2d..e610a2b2d 100644 --- a/src/components/schemas/employee_field.yaml +++ b/src/components/schemas/employee_field.yaml @@ -1,6 +1,16 @@ employee_field_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - name + - type + - options + - is_mandatory + - is_enabled properties: id: $ref: './fields.yaml#/id_integer' diff --git a/src/components/schemas/employee_filters.yaml b/src/components/schemas/employee_filters.yaml index d993b0f9d..f834479c8 100644 --- a/src/components/schemas/employee_filters.yaml +++ b/src/components/schemas/employee_filters.yaml @@ -16,6 +16,15 @@ employee_filters_in: employee_filters_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - user_id + - name + - is_shared + - query_string properties: id: allOf: diff --git a/src/components/schemas/employee_settings.yaml b/src/components/schemas/employee_settings.yaml index 0c1ee61ff..3551425ca 100644 --- a/src/components/schemas/employee_settings.yaml +++ b/src/components/schemas/employee_settings.yaml @@ -1,6 +1,29 @@ spender_employee_settings_out: type: object additionalProperties: false + required: + - id + - employee_id + - org_id + - created_at + - updated_at + - category_ids + - cost_center_ids + - project_ids + - per_diem_rate_ids + - mileage_rate_ids + - insta_fyle_settings + - notification_settings + - mileage_settings + - expense_form_autofills + - data_extractor_settings + - in_app_chat_settings + - payment_mode_settings + - locale + - is_personal_cards_enabled + - default_project_id + - default_payment_mode + - default_vehicle_type properties: id: $ref: './fields.yaml#/id_string' @@ -131,21 +154,7 @@ spender_employee_settings_out: example: true description: Whether to notify the delegatee about events mileage_settings: - type: object - nullable: true - additionalProperties: false - description: Settings for mileage tracking and rates - properties: - mileage_rate_labels: - type: object - nullable: true - example: null - description: Labels for different mileage rates - annual_mileage_of_user_before_joining_fyle: - type: object - nullable: true - example: {} - description: Annual mileage limit for user before joining Sage Exp Mgmt + $ref: './fields.yaml#/mileage_settings' expense_form_autofills: type: object nullable: true @@ -227,20 +236,24 @@ spender_employee_settings_out: nullable: true additionalProperties: false description: Settings for user's locale and timezone + required: + - timezone + - abbreviation + - offset properties: timezone: type: string - nullable: true + nullable: false example: "Asia/Kolkata" description: User's timezone abbreviation: type: string - nullable: true + nullable: false example: "IST" description: Timezone abbreviation offset: type: string - nullable: true + nullable: false example: "05:30:00" description: Timezone offset from UTC is_personal_cards_enabled: @@ -266,13 +279,16 @@ spender_employee_settings_out: spender_employee_settings_in: type: object additionalProperties: false + required: + - id + - employee_id properties: id: $ref: './fields.yaml#/id_string' - description: Unique identifier for the employee settings (optional) + description: Unique identifier for the employee settings employee_id: $ref: './fields.yaml#/id_string' - description: Unique identifier of the employee (optional) + description: Unique identifier of the employee cost_center_ids: type: array items: @@ -300,22 +316,35 @@ spender_employee_settings_in: description: List of categories that the employee has access to locale: type: object + nullable: true additionalProperties: false description: Settings for user's locale and timezone + required: + - timezone + - abbreviation + - offset properties: timezone: type: string + nullable: false description: User's timezone abbreviation: type: string + nullable: false description: Timezone abbreviation offset: type: string + nullable: false description: Timezone offset from UTC insta_fyle_settings: type: object additionalProperties: false description: Settings for InstaFyle receipt scanning and data extraction + required: + - allowed + - enabled + - static_camera_overlay_enabled + - extract_fields properties: allowed: type: boolean @@ -335,6 +364,15 @@ spender_employee_settings_in: type: object additionalProperties: false description: Settings for email and push notifications + required: + - email_allowed + - email_enabled + - email_unsubscribed_events + - push_allowed + - push_enabled + - push_unsubscribed_events + - notify_user + - notify_delegatee properties: email_allowed: type: boolean @@ -368,6 +406,9 @@ spender_employee_settings_in: type: object additionalProperties: false description: Settings for automatic form filling in expenses + required: + - allowed + - enabled properties: allowed: type: boolean @@ -379,6 +420,9 @@ spender_employee_settings_in: type: object additionalProperties: false description: Settings for data extraction from receipts + required: + - allowed + - enabled properties: allowed: type: boolean @@ -390,6 +434,9 @@ spender_employee_settings_in: type: object additionalProperties: false description: Settings for in-app chat functionality + required: + - allowed + - enabled properties: allowed: type: boolean @@ -405,6 +452,10 @@ spender_employee_settings_in: type: object additionalProperties: false description: Settings for payment modes + required: + - allowed + - enabled + - allowed_payment_modes properties: allowed: type: boolean diff --git a/src/components/schemas/employees_export_configurations.yaml b/src/components/schemas/employees_export_configurations.yaml index 99bd28463..f8339ec77 100644 --- a/src/components/schemas/employees_export_configurations.yaml +++ b/src/components/schemas/employees_export_configurations.yaml @@ -1,4 +1,8 @@ employees_export_configuration_column: + required: + - name + - formula + - is_custom type: object properties: name: @@ -38,6 +42,10 @@ employees_export_configuration_column: employees_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -61,6 +69,8 @@ employees_export_configuration_sort_column: employees_export_configuration_separate_line_items_entry: type: object + required: + - is_enabled properties: is_enabled: type: boolean @@ -85,6 +95,11 @@ employees_export_configuration_separate_line_items_entry: employees_export_configuration_config: type: object + required: + - is_header_visible + - separate_line_items_entry + - columns + - date_format additionalProperties: true properties: is_header_visible: @@ -159,9 +174,9 @@ employees_export_configuration_in: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature employees_export_configuration_in_only_id: @@ -177,6 +192,17 @@ employees_export_configuration_in_only_id: employees_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -192,16 +218,6 @@ employees_export_configuration_out: $ref: './fields.yaml#/created_at' updated_at: $ref: './fields.yaml#/updated_at' - created_by: - allOf: - - $ref: './user.yaml#/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: './user.yaml#/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | diff --git a/src/components/schemas/employees_exports.yaml b/src/components/schemas/employees_exports.yaml index 5e9c24369..b348fad55 100644 --- a/src/components/schemas/employees_exports.yaml +++ b/src/components/schemas/employees_exports.yaml @@ -1,5 +1,8 @@ employees_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -49,6 +52,8 @@ employees_export_config: default: true separate_line_items_entry: type: object + required: + - enabled properties: enabled: type: boolean @@ -118,6 +123,20 @@ employees_exports_in: employees_exports_out: type: object + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - notify_emails + - config + - file_id + - state + - processed_at + - completed_at + - failed_at properties: created_at: type: string diff --git a/src/components/schemas/expense.yaml b/src/components/schemas/expense.yaml index 15d0b16d8..1999ace8f 100644 --- a/src/components/schemas/expense.yaml +++ b/src/components/schemas/expense.yaml @@ -30,12 +30,18 @@ expense_out: - source_account - tax_amount - tax_group_id + - calculated_tax_amount - is_billable - is_reimbursable - distance - distance_unit - mileage_calculated_distance - mileage_calculated_amount + - selected_vehicle_ownership + - selected_vehicle_category + - passenger_count + - passenger_mileage_rate + - passenger_amount - mileage_rate_id - mileage_rate - mileage_is_round_trip @@ -54,6 +60,7 @@ expense_out: - seq_num - report_id - added_to_report_at + - added_to_report_by - report - is_verified - last_verified_at @@ -66,6 +73,8 @@ expense_out: - is_corporate_card_transaction_auto_matched - matched_corporate_card_transaction_ids - matched_corporate_card_transactions + - matched_corporate_card_transaction_id + - matched_corporate_card_transaction - last_settled_at - missing_mandatory_fields - activity_details @@ -79,6 +88,26 @@ expense_out: - invoice_number - is_duplicate_present - expense_policy_comments + - custom_fields_flattened + - approvals + - verifications + - employee_id + - split_group_amount + - expense_rule_id + - expense_rule_data + - is_split + - tax_group + - approver_comments + - verifier_comments + - policy_checks + - accounting_export_summary + - report_last_paid_at + - report_last_approved_at + - commute_deduction + - commute_details_id + - commute_details + - is_reconciled + - report_auto_approval_state properties: id: allOf: @@ -201,6 +230,12 @@ expense_out: allOf: - $ref: './fields.yaml#/fk_string' nullable: true + calculated_tax_amount: + type: number + nullable: true + readOnly: true + description: | + System-derived tax amount for the expense amount and the selected tax group's rate. is_billable: type: boolean nullable: true @@ -231,6 +266,36 @@ expense_out: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + selected_vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Selected vehicle ownership for an advanced mileage expense. `null` for a basic mileage expense. + selected_vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Selected vehicle category for an advanced mileage expense. `null` for a basic mileage expense. + passenger_count: + type: integer + nullable: true + description: Number of passengers carried on the mileage journey. + passenger_mileage_rate: + type: number + nullable: true + readOnly: true + description: Passenger mileage rate snapshot applied to this expense. `null` when passenger mileage does not apply. + passenger_amount: + type: number + nullable: true + description: Passenger mileage reimbursement amount for this expense. mileage_rate_id: allOf: - $ref: './fields.yaml#/fk_integer' @@ -334,6 +399,16 @@ expense_out: description: | signifies when this expense was added to a report. If this expense is not added to a report, then this could be null. + added_to_report_by: + type: string + nullable: true + enum: + - USER + - SYSTEM + - null + description: | + Indicates whether the expense was added to the report it belongs to by a user or the system. If the expense is not a part of any report, this field will be null. + example: USER report: $ref: './report.yaml#/report_out_embed' is_verified: @@ -413,6 +488,8 @@ expense_out: $ref: './fields.yaml#/id_string' description: | Holds the corporate card transaction ids which are matched to this expense + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction_id` instead, as this array always contains a single value. example: - btxnwownwrng matched_corporate_card_transactions: @@ -422,6 +499,20 @@ expense_out: description: | Holds the corporate card transactions which are matched to this expense. NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_ids` is already up-to-date. + + **NOTE**: This array field is planned for deprecation in future. Please consider using the field `matched_corporate_card_transaction` instead, as this array always contains a single value. + matched_corporate_card_transaction_id: + type: string + nullable: true + description: | + Holds the corporate card transaction id which is matched to this expense + example: btxnwownwrng + matched_corporate_card_transaction: + allOf: + - $ref: '#/matched_corporate_card_transaction_out_embed_new' + description: | + Holds the corporate card transaction which is matched to this expense. + NOTE: The data of this field is not realtime. It will get updated later even if `matched_corporate_card_transaction_id` is already up-to-date. last_settled_at: allOf: - $ref: './fields.yaml#/timestamptz_utc' @@ -590,6 +681,15 @@ expense_out: description: | Whether expenses is reconciled or not. example: true + report_auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the expense's report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null expense_in: type: object @@ -688,6 +788,16 @@ expense_in: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. mileage_rate_id: allOf: - $ref: './fields.yaml#/fk_integer' @@ -749,8 +859,6 @@ expense_in: spender_expense_in: type: object additionalProperties: false - required: - - claim_amount properties: id: $ref: './fields.yaml#/id_string' @@ -900,6 +1008,16 @@ spender_expense_in: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. commute_details_id: type: integer nullable: true @@ -1030,6 +1148,54 @@ spender_check_policies_bulk_in: items: $ref: '#/spender_expenses_bulk_in/items' +admin_expenses_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be updated in bulk by the admin. + items: + $ref: '#/spender_expenses_bulk_in/items' + +admin_expense_check_mandatory_fields_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be checked for missing mandatory fields by admin. + items: + $ref: '#/spender_expenses_bulk_in/items' + +admin_check_policies_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be validated against expense policy rules by admin. + items: + $ref: '#/spender_expenses_bulk_in/items' + +approver_expenses_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be updated in bulk by the approver. + items: + $ref: '#/spender_expenses_bulk_in/items' + +approver_expense_check_mandatory_fields_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be checked for missing mandatory fields by approver. + items: + $ref: '#/spender_expenses_bulk_in/items' + +approver_check_policies_bulk_in: + type: array + additionalProperties: false + description: | + Array of expenses to be validated against expense policy rules by approver. + items: + $ref: '#/spender_expenses_bulk_in/items' + admin_expense_in: type: object additionalProperties: false @@ -1037,7 +1203,7 @@ admin_expense_in: - required: - admin_amount - assignee_user_email - - required: + - required: - id properties: id: @@ -1053,7 +1219,7 @@ admin_expense_in: The expense amount which is added or modified by admin or approver. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: 1900 spent_at: type: string @@ -1064,7 +1230,7 @@ admin_expense_in: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' assignee_user_email: allOf: @@ -1074,9 +1240,9 @@ admin_expense_in: Must be compliant with RFC 822. - **Note:** - - The expense will be assigned/re-assigned to this particular `employee`. + - The expense will be assigned/re-assigned to this particular `employee`. - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. - Admins can't assign the expense to self. source: $ref: './fields.yaml#/source' @@ -1118,7 +1284,7 @@ admin_expense_in: tax_amount: type: number nullable: true - description: | + description: | Tax amount as setup by your organization. - _Note:_ - Tax amount cannot be greater than the expense amount. @@ -1178,6 +1344,16 @@ admin_expense_in: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. commute_details_id: type: integer nullable: true @@ -1216,7 +1392,7 @@ admin_expense_in: approver_expense_in: type: object additionalProperties: false - required: + required: - id properties: id: @@ -1230,7 +1406,7 @@ approver_expense_in: description: | The expense amount which is added or modified by admin or approver. - **Note:** - - _This field is non-nullable_. + - _This field is non-nullable_. example: 1900 spent_at: type: string @@ -1240,7 +1416,7 @@ approver_expense_in: It signifies when this expense was made. This date cannot be in future. - **Note:** - - _This field is non-nullable_. + - _This field is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' source: $ref: './fields.yaml#/source' @@ -1282,7 +1458,7 @@ approver_expense_in: tax_amount: type: number nullable: true - description: | + description: | Tax amount as setup by your organization. - _Note:_ - Tax amount cannot be greater than the expense amount. @@ -1333,6 +1509,16 @@ approver_expense_in: type: number nullable: true description: Amount computed by Sage Exp Mgmt in mileage expenses. + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. commute_details_id: type: integer nullable: true @@ -1368,6 +1554,15 @@ approver_expense_in: Specific to per diem related expenses, number of days for which per diem claim is made.
This field is required for creating Per Diem Expenses. +expense_out_with_department_name: + allOf: + - $ref: '#/expense_out' + - type: object + properties: + employee: + nullable: true + $ref: './employee.yaml#/employee_out_embed_for_expense_with_department_name' + expense_out_embed: type: object required: @@ -1473,6 +1668,21 @@ matched_corporate_card_transaction_out_embed: - id - corporate_card_id - corporate_card_number + - corporate_card_nickname + - masked_corporate_card_number + - bank_name + - corporate_card_user_full_name + - amount + - currency + - spent_at + - posted_at + - status + - description + - foreign_currency + - foreign_amount + - merchant + - category + - matched_by properties: id: allOf: @@ -1517,6 +1727,11 @@ matched_corporate_card_transaction_out_embed: description: | String denoting the card holder's full name example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false amount: $ref: './fields.yaml#/amount' currency: @@ -1581,6 +1796,130 @@ matched_corporate_card_transaction_out_embed: example: john.ooe@sage.com +matched_corporate_card_transaction_out_embed_new: + anyOf: + - type: object + additionalProperties: false + properties: {} + description: Empty object when no corporate card transaction is matched + - type: object + required: + - id + - corporate_card_id + - corporate_card_number + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: btxnwownwrng + corporate_card_id: + allOf: + - $ref: './fields.yaml#/id_string' + example: bawownwrng + corporate_card_number: + $ref: './fields.yaml#/card_number' + corporate_card_nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: 'Business Card' + corporate_card_cardholder_name: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the card holder's name + example: John Cena + capitalone_virtual_card_last_four: + type: string + nullable: true + description: | + Last four digits of capitalone virtual card. + example: "4521" + masked_corporate_card_number: + $ref: './fields.yaml#/card_number' + bank_name: + nullable: true + $ref: './fields.yaml#/bank_name' + corporate_card_user_full_name: + nullable: true + allOf: + - $ref: './fields.yaml#/name_nullable' + maxLength: 255 + description: | + String denoting the card holder's full name + example: John Doe + is_corporate_card_archived: + type: boolean + description: | + Signifies whether the corporate card is archived or not. + nullable: false + amount: + $ref: './fields.yaml#/amount' + currency: + $ref: './fields.yaml#/currency' + spent_at: + allOf: + - $ref: './fields.yaml#/spent_at' + description: | + Signifies spent date of a card transaction. + This date cannot be in future. + posted_at: + nullable: true + allOf: + - $ref: './fields.yaml#/timestamptz_utc' + description: | + Signifies post date of a card transaction. + This date cannot be in future. + status: + type: string + nullable: true + enum: + - PENDING + - POSTED + - null + example: PENDING + description: | + Signifies status of a card transaction. + description: + type: string + nullable: true + description: | + Holds the description of the card transaction + example: Team lunch + foreign_currency: + nullable: true + allOf: + - $ref: './fields.yaml#/foreign_currency' + foreign_amount: + nullable: true + allOf: + - $ref: './fields.yaml#/foreign_amount' + merchant: + nullable: true + allOf: + - $ref: './fields.yaml#/merchant' + description: | + String denoting the name of the vendor to which the card transaction was made. + Note: This is not same as the merchant added in Sage Exp Mgmt but just a string + category: + type: string + maxLength: 255 + nullable: true + description: | + String denoting the category of the card transaction + Note: This is not same as the category added in Sage Exp Mgmt but just a string + example: Travel + matched_by: + type: string + nullable: true + description: | + String denoting the email of the user who matched the card transaction to an expense. + example: john.ooe@sage.com + + expense_attach_receipt_in: type: object required: @@ -1785,9 +2124,9 @@ expense_check_policies_in: Invoice number of the expense. example: 123456 - # TODO: Update the below remaining fields in this object based on how do we decide to do mileage calculations - # when mileage support comes to platform world. If we will give APIs for distance and amount calculation, - # then we will link the respective APIs in the description. If we decide to auto compute it in backend, then + # TODO: Update the below remaining fields in this object based on how do we decide to do mileage calculations + # when mileage support comes to platform world. If we will give APIs for distance and amount calculation, + # then we will link the respective APIs in the description. If we decide to auto compute it in backend, then # these fields might need to be dropped. mileage_calculated_distance: type: number @@ -1797,10 +2136,23 @@ expense_check_policies_in: type: number nullable: true description: Specific to mileage expense. Amount computed by Sage Exp Mgmt for mileage expenses. + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. expense_check_policies_out: type: object additionalProperties: False + required: + - individual_desired_states + - final_desired_state properties: individual_desired_states: type: array @@ -1835,12 +2187,28 @@ expense_delete_in: $ref: './fields.yaml#/id_string' +expenses_count_out: + type: object + additionalProperties: False + required: + - count + properties: + count: + type: integer + minimum: 0 + nullable: false + description: Number of expenses matching the requested state and enabled-employee criteria. + example: 33 + + expenses_stats_in: + required: + - query_params properties: query_params: nullable: False type: string - description: | + description: | Query param string similar to expenses GET call. Use group_by_state=eq.true to get state-wise grouping of stats. example: id=in.('tx1263', 'tx1569')&group_by_state=eq.true @@ -1878,8 +2246,8 @@ expenses_stats_out: - PAID - UNREPORTABLE description: Expense state - # NOTE: This is a hack to maintain backward compatibility with the existing response structure - # TODO: @Dev to update the response once the hack is removed from platform-api + # NOTE: This is a hack to maintain backward compatibility with the existing response structure + # TODO: @Dev to update the response once the hack is removed from platform-api - type: object title: "Overall stats" description: Overall stats without state grouping @@ -1950,7 +2318,7 @@ accounting_export_summary_in: url: type: string description: URL Endpoint for exported / failed expense - example: https://app.example.com/expense/txwownwrng + example: https://app.example.com/expense/txwownwrng spender_expense_check_mandatory_fields_in: type: object additionalProperties: false @@ -2029,6 +2397,16 @@ spender_expense_check_mandatory_fields_in: $ref: './fields.yaml#/distance' distance_unit: $ref: './fields.yaml#/distance_unit' + passenger_count: + type: integer + nullable: true + description: | + Number of passengers carried on the mileage journey. For advanced CAR mileage when passenger mileage is enabled, this is optional; when provided, it must be between 1 and 6. It must be `0` for MOTORCYCLE or BICYCLE mileage, and `null` for basic mileage or when passenger mileage is disabled. + passenger_amount: + type: number + nullable: true + description: | + Passenger mileage reimbursement amount for this expense. For advanced CAR mileage when passenger mileage is enabled and `passenger_count` is provided, it must equal `passenger_count * passenger_mileage_rate * distance`, rounded to two decimal places. It must be `null` when `passenger_count` is `null`, for basic mileage, or when passenger mileage is disabled; no passenger reimbursement is applied for MOTORCYCLE or BICYCLE mileage. started_at: $ref: './fields.yaml#/timestamptz_pst' ended_at: @@ -2167,6 +2545,8 @@ expense_comments_out: - org_id - updated_at - created_at + - creator_user_id + - creator_user properties: id: $ref: './fields.yaml#/id_string' @@ -2199,9 +2579,7 @@ expense_comments_out: - UNMATCHED example: COMMENTED_WITH_NOTIFICATION action_data: - type: object - description: Data related to expense action. - nullable: true + $ref: './expense.yaml#/expense_action_data_embed' expense_id: $ref: './fields.yaml#/id_string' creator_type: @@ -2233,7 +2611,6 @@ expense_comments_bulk_in: required: - expense_id - comment - - notify properties: expense_id: $ref: './fields.yaml#/id_string' @@ -2246,6 +2623,11 @@ expense_comments_bulk_in: description: Whether to notify the user about the comment example: true +expense_action_data_embed: + type: object + description: Data related to expense action. + nullable: true + expense_dismiss_duplicates_in: type: object required: @@ -2263,10 +2645,12 @@ expense_dismiss_duplicates_in: example: ['txwoirwlwwg', 'txwlgwkgw42'] description: | List of expense IDs that needs to be dismissed as a duplicate from the target expense - + expense_duplicate_sets_out: type: object additionalProperties: false + required: + - expense_ids properties: expense_ids: type: array @@ -2280,6 +2664,9 @@ expense_duplicate_sets_out: expense_verification_out_embed: type: object additionalProperties: false + required: + - verifier_user_id + - verifier_user properties: verifier_user_id: allOf: @@ -2300,7 +2687,7 @@ expense_split_object: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' category_id: allOf: @@ -2344,7 +2731,7 @@ split_expense_in: This date cannot be in future. - **Note:** - This field is required while creating an expense. - - _Not required when updating an expense, but is non-nullable_. + - _Not required when updating an expense, but is non-nullable_. example: '2020-06-01T01:18:19.292-08:00' is_reimbursable: $ref: './fields.yaml#/is_reimbursable' @@ -2386,7 +2773,7 @@ split_expense_in: tax_amount: type: number nullable: true - description: | + description: | Tax amount as setup by your organization. - _Note:_ - Tax amount cannot be greater than the expense amount. @@ -2758,6 +3145,9 @@ expense_policy_comment_out_embed: example: epc1a2f3farmk comment_type: type: string + enum: + - LOST_RECEIPT_REASON + - POLICY_VIOLATION_REASON description: Type of the policy comment comment_text: type: string diff --git a/src/components/schemas/expense_duplicate_set.yaml b/src/components/schemas/expense_duplicate_set.yaml index 65307d2e1..391fa97bc 100644 --- a/src/components/schemas/expense_duplicate_set.yaml +++ b/src/components/schemas/expense_duplicate_set.yaml @@ -1,4 +1,7 @@ expenses_duplicate_sets_stats_in: + type: object + required: + - query_params properties: query_params: nullable: False @@ -10,6 +13,8 @@ expenses_duplicate_sets_stats_in: expenses_duplicate_sets_stats_out: type: object + required: + - count properties: count: type: integer diff --git a/src/components/schemas/expense_field.yaml b/src/components/schemas/expense_field.yaml index db356c5bd..de2034c68 100644 --- a/src/components/schemas/expense_field.yaml +++ b/src/components/schemas/expense_field.yaml @@ -1,6 +1,25 @@ expense_field_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - seq + - field_name + - column_name + - type + - options + - default_value + - placeholder + - category_ids + - is_enabled + - is_custom + - is_mandatory + - code + - parent_field_id + - display_order properties: id: $ref: './fields.yaml#/id_integer' @@ -72,6 +91,13 @@ expense_field_out: description: | This specifies the `id` of the parent expense field and denotes that the expense field is a dependent custom field. NOTE: `type` must be `DEPENDENT_SELECT`. example: 1234 + display_order: + type: integer + nullable: true + readOnly: true + description: | + The 1-based position of an enabled, non-dependent custom expense field in the organization's custom order. + example: 1 expense_field_in: type: object @@ -151,3 +177,12 @@ expense_field_in: description: | This specifies the `id` of the parent expense field and denotes that the expense field is a dependent custom field. NOTE: `type` must be `DEPENDENT_SELECT`. example: 1234 + +expense_field_reorder_in: + type: object + additionalProperties: false + required: + - id + properties: + id: + $ref: './fields.yaml#/id_integer' diff --git a/src/components/schemas/expense_filters.yaml b/src/components/schemas/expense_filters.yaml index 9ccbd4954..624c87c9d 100644 --- a/src/components/schemas/expense_filters.yaml +++ b/src/components/schemas/expense_filters.yaml @@ -18,6 +18,16 @@ expense_filters_in: expense_filters_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - user_id + - name + - is_shared + - query_string + - sub_feature properties: id: allOf: diff --git a/src/components/schemas/expense_policies.yaml b/src/components/schemas/expense_policies.yaml index 15b79ad9c..8f1415fa8 100644 --- a/src/components/schemas/expense_policies.yaml +++ b/src/components/schemas/expense_policies.yaml @@ -35,6 +35,8 @@ expense_policy_in: - expense_amount_max - expense_payment_modes - expense_payment_modes_op + - expense_merchants + - expense_merchants_op - expense_without_ccc_match_allowed - employee_department_ids - employee_department_ids_op @@ -45,6 +47,7 @@ expense_policy_in: - employee_titles_op - action_flag - action_show_warning + - policy_violation_reason_required - action_make_unreportable - description default: True @@ -231,6 +234,21 @@ expense_policy_in: - $ref: ./fields.yaml#/contains_operator description: | _Note: This field is mandatory if the field `expense_payment_modes` is present in the request body._ + expense_merchants: + type: array + items: + type: string + description: | + List of merchant names to be checked against expense merchant for applying this policy rule.
+ _Note: You need to use field `expense_merchants_op` along with this field._
+ _Note: This field is allowed only when `expense_without_receipt_allowed` is false._ + example: ['Uber', 'Amazon'] + expense_merchants_op: + allOf: + - $ref: ./fields.yaml#/contains_from_list_operator + description: | + _Note: This field is mandatory if the field `expense_merchants` is present in the request body._
+ _Note: This field is allowed only when `expense_without_receipt_allowed` is false._ expense_without_ccc_match_allowed: type: boolean description: | @@ -374,6 +392,13 @@ expense_policy_in: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: False example: True + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule.
+ _Note: This can be true only when `action_show_warning` is true._ + default: False + example: False action_make_unreportable: type: boolean description: | @@ -440,6 +465,77 @@ expense_policy_in: expense_policy_out: type: object additionalProperties: True + required: + - created_at + - updated_at + - id + - org_id + - is_enabled + - is_retired + - description + - source + - creator_user_id + - creator_user + - approver_order + - is_approver_policy + - employee_department_ids + - employee_department_ids_op + - employee_level_ids + - employee_level_ids_op + - employee_titles + - employee_titles_op + - employee_user_ids + - employee_user_ids_op + - employee_custom_fields + - employee_custom_fields_op + - employee_locations + - employee_locations_op + - expense_category_ids + - expense_category_ids_op + - expense_limit_type + - expense_amount_max + - expense_amount_min + - expense_creation_delay_days_max + - expense_currency + - expense_without_receipt_allowed + - expense_allowed_distance_difference_percentage + - expense_flight_travel_class + - expense_project_ids + - expense_project_ids_op + - expense_train_travel_class + - expense_spent_at_max + - expense_spent_at_min + - expense_locations + - expense_locations_op + - expense_allowed_exchange_rate_difference_percentage + - expense_include_foreign_currency + - expense_annual_distance_max + - expense_vehicle_type + - expense_cost_center_ids + - expense_cost_center_ids_op + - expense_distance_max + - expense_distance_min + - expense_custom_fields + - expense_custom_fields_op + - expense_without_ccc_match_allowed + - expense_fiscal_start_month + - expense_payment_modes + - expense_payment_modes_op + - action_flag + - action_show_warning + - action_cap_amount + - action_make_unreportable + - action_remove_employee_approver1 + - action_add_employee_approver2 + - action_add_employee_approver3 + - action_add_project_approver1 + - action_add_project_approver2 + - action_add_department_head_approver + - action_add_approver_user_ids + - action_override_distance_slab_rate + - expense_merchants + - expense_merchants_op + - policy_violation_reason_required properties: id: allOf: @@ -661,6 +757,20 @@ expense_policy_out: nullable: true allOf: - $ref: ./fields.yaml#/contains_operator + expense_merchants: + nullable: true + type: array + items: + type: string + description: | + List of merchant names considered by this policy rule. + example: ['Uber', 'Amazon'] + expense_merchants_op: + nullable: true + allOf: + - $ref: ./fields.yaml#/contains_from_list_operator + description: | + Operator to apply on `expense_merchants`. expense_without_ccc_match_allowed: type: boolean description: | @@ -789,6 +899,12 @@ expense_policy_out: If it is set to true, then a warning is shown to the employee, whenever he attempts to create an expense that violates this policy rule. default: False example: True + policy_violation_reason_required: + type: boolean + description: | + If it is set to true, then entering a policy violation reason becomes mandatory for expenses violating this policy rule. + default: False + example: False action_make_unreportable: type: boolean description: | @@ -874,6 +990,10 @@ expense_policy_state_change_in: expense_policy_states_out: type: object additionalProperties: False + required: + - expense_id + - individual_desired_states + - final_desired_state properties: expense_id: type: string diff --git a/src/components/schemas/expense_rules.yaml b/src/components/schemas/expense_rules.yaml index ebc4fa6e2..6897cec28 100644 --- a/src/components/schemas/expense_rules.yaml +++ b/src/components/schemas/expense_rules.yaml @@ -26,6 +26,8 @@ expense_rule_if_out: additionalProperties: false required: - merchant_contains + - department_ids + - departments properties: merchant_contains: type: string @@ -100,6 +102,18 @@ expense_rule_data_out: nullable: false additionalProperties: false minProperties: 1 + required: + - merchant + - is_billable + - purpose + - category_id + - category + - project_id + - project + - cost_center_id + - cost_center + - custom_fields + - dependent_fields properties: merchant: type: string @@ -181,6 +195,8 @@ expense_rule_out: - creator_user - if - set + - is_suggested + - is_suggestion_dismissed properties: id: allOf: diff --git a/src/components/schemas/expenses_export_configurations.yaml b/src/components/schemas/expenses_export_configurations.yaml index 1a9ccec3a..d5793430c 100644 --- a/src/components/schemas/expenses_export_configurations.yaml +++ b/src/components/schemas/expenses_export_configurations.yaml @@ -69,6 +69,10 @@ expenses_export_pdf_configuration_column: expenses_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -118,7 +122,7 @@ expenses_export_configuration_config: type: object additionalProperties: true properties: - is_column_header_included: + is_header_visible: type: boolean description: | Whether to include column headers in the export file. Required for CSV and EXCEL export types. @@ -223,9 +227,9 @@ expenses_export_configuration_in: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature expenses_export_configuration_in_only_id: @@ -241,6 +245,17 @@ expenses_export_configuration_in_only_id: expenses_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -256,16 +271,6 @@ expenses_export_configuration_out: $ref: './fields.yaml#/created_at' updated_at: $ref: './fields.yaml#/updated_at' - created_by: - allOf: - - $ref: './user.yaml#/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: './user.yaml#/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | diff --git a/src/components/schemas/expenses_exports.yaml b/src/components/schemas/expenses_exports.yaml index 562138553..de5d94e8f 100644 --- a/src/components/schemas/expenses_exports.yaml +++ b/src/components/schemas/expenses_exports.yaml @@ -1,5 +1,8 @@ expenses_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -113,6 +116,17 @@ expenses_exports_in: expenses_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - query_params + - notify_emails + - config + - file_id + - state properties: created_at: $ref: './fields.yaml#/created_at' diff --git a/src/components/schemas/feature_configs.yaml b/src/components/schemas/feature_configs.yaml index e8c954a00..2bb85dcca 100644 --- a/src/components/schemas/feature_configs.yaml +++ b/src/components/schemas/feature_configs.yaml @@ -1,6 +1,17 @@ feature_config_out: type: object additionalProperties: false + required: + - org_id + - user_id + - created_at + - updated_at + - target_client + - feature + - sub_feature + - key + - value + - is_shared properties: org_id: $ref: ./fields.yaml#/org_id diff --git a/src/components/schemas/fields.yaml b/src/components/schemas/fields.yaml index aca92edd1..77526d3de 100644 --- a/src/components/schemas/fields.yaml +++ b/src/components/schemas/fields.yaml @@ -346,6 +346,26 @@ contains_operator: Value signifying the operator for the field example: IN +contains_from_list_operator: + nullable: true + type: string + enum: + - CONTAINS_ANY_FROM_LIST + - CONTAINS_NONE_FROM_LIST + - null + description: > + Value signifying the operator for matching values from a list field. + example: CONTAINS_ANY_FROM_LIST + +delegation_access_scope: + type: array + description: | + List of scopes for the delegate. + items: + type: string + enum: [ALL, SUBMIT, APPROVE] + example: ["SUBMIT", "APPROVE"] + expense_policy_rule_embed: type: object additionalProperties: false @@ -365,6 +385,11 @@ expense_policy_rule_embed: description: | A true value here means that policy calculation suggests showing a warning when the user attempts to create an expense that violates this expense policy rule. example: True + policy_violation_reason_required: + type: boolean + description: | + A true value here means that entering a policy violation reason is mandatory for this policy rule. + example: false action_make_unreportable: type: boolean nullable: false @@ -374,6 +399,11 @@ expense_policy_rule_embed: expense_policy_expenses_query_object: type: object + required: + - limit_start_date + - limit_end_date + - params + nullable: true description: | An expense may be violating an expense policy rule due to a group of other expenses. These query params can be used to fetch those expenses because of which this expense is causing a violation.
@@ -384,6 +414,7 @@ expense_policy_expenses_query_object: description: | Spend start date query param to find the list of violating expenses. example: "2021-12-01" + nullable: true limit_end_date: type: string description: | @@ -394,6 +425,16 @@ expense_policy_expenses_query_object: expense_check_policies_individual_desired_states: type: object + required: + - add_approver_user_ids + - approver_policy_order + - approver_source + - expense_policy_rule_id + - expense_policy_rule + - run_status + - run_result + - amount + - expenses_query_object properties: add_approver_user_ids: nullable: true @@ -468,12 +509,21 @@ expense_check_policies_individual_desired_states: description: | Amount that the policy calculation suggests for this expense. example: 500 - expenses_query_object_params: + expenses_query_object: nullable: true $ref: '#/expense_policy_expenses_query_object' expense_check_policies_final_desired_state: type: object + required: + - flag + - amount + - unreportable + - is_receipt_mandatory + - add_approver_user_ids + - remove_employee_approver1 + - run_status + - run_summary properties: flag: type: boolean @@ -535,6 +585,17 @@ expense_check_policies_final_desired_state: expense_policy_individual_desired_states: type: object + required: + - add_approver_user_ids + - approver_policy_order + - approver_source + - expense_id + - expense_policy_rule_id + - expense_policy_rule + - run_status + - run_result + - amount + - expenses_query_object properties: add_approver_user_ids: nullable: true @@ -605,7 +666,7 @@ expense_policy_individual_desired_states: description: | This represents the id of the expense policy rule. example: "tprabsdfSYqd" - rule: + expense_policy_rule: $ref: '#/expense_policy_rule_embed' amount: nullable: true @@ -615,7 +676,7 @@ expense_policy_individual_desired_states: description: | Amount that the policy calculation suggests for this expense. example: 500 - expenses_query_object_params: + expenses_query_object: nullable: true $ref: '#/expense_policy_expenses_query_object' @@ -655,6 +716,16 @@ expense_policy_expenses_query_object_params: expense_policy_final_desired_state: type: object + required: + - expense_id + - flag + - amount + - unreportable + - is_receipt_mandatory + - add_approver_user_ids + - remove_employee_approver1 + - run_status + - run_summary properties: expense_id: type: string @@ -1124,6 +1195,9 @@ missing_mandatory_fields: schedule_config: type: object nullable: false + required: + - type + - when properties: type: nullable: false @@ -1246,6 +1320,17 @@ budget_visibility: Visibility of the budget example: ONLY_ADMINS +budget_status: + type: string + enum: + - ON_TRACK + - NEAR_LIMIT + - EXCEEDED + - DISABLED + description: | + Status of budget usage + example: ON_TRACK + budget_user_ids: type: array nullable: True @@ -1380,6 +1465,14 @@ reminder_schedule_config: pattern: '^[1-7](?:,[1-7])*$' example: 1,3,5 description: comma-separated day numbers (e.g. "1,3,5" for mon,wed,fri) + week: + oneOf: + - type: number + example: 2 + description: Week of the month (number, e.g. 2) + - type: string + example: '*/1' + description: cron expression (e.g. '*/1' for every week, '*/2' for every alternate week) hour: type: number example: 22 @@ -1595,6 +1688,14 @@ ach_transfer_state: delegatees: type: object additionalProperties: False + required: + - id + - type + - user_id + - email + - full_name + - start_at + - scopes properties: id: allOf: @@ -1634,6 +1735,10 @@ delegatees: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: True + scopes: + allOf: + - $ref: './fields.yaml#/delegation_access_scope' + nullable: True locale: type: object @@ -1801,7 +1906,9 @@ any_type: items: $ref: './fields.yaml#/any_type' - type: object - + additionalProperties: + $ref: '#/components/schemas/any_type' + - {} commute_location: type: object nullable: true @@ -1833,6 +1940,12 @@ commute_location: commute_details: type: object + required: + - id + - distance + - distance_unit + - home_location + - work_location nullable: true description: | Commute details of the employee. This is used to deduct daily commute from the employee's mileage expenses. @@ -1873,6 +1986,13 @@ commute_details: commute_location_not_nullable: type: object nullable: false + required: + - city + - state + - country + - formatted_address + - latitude + - longitude properties: city: type: string @@ -1905,6 +2025,11 @@ commute_details_in: additionalProperties: False description: | Commute details of the employee. This is used to deduct daily commute from the employee's mileage expenses. + required: + - distance + - distance_unit + - home_location + - work_location properties: home_location: allOf: @@ -1943,6 +2068,11 @@ has_accepted_invite: delegatee: type: object additionalProperties: False + required: + - user_id + - start_at + - end_at + - scopes properties: user_id: type: string @@ -1961,6 +2091,11 @@ delegatee: description: | Date and time till which the delegation is active. If null, delegation is active indefinitely. nullable: True + scopes: + allOf: + - $ref: './fields.yaml#/delegation_access_scope' + nullable: True + subscribed_resources: type: array diff --git a/src/components/schemas/file.yaml b/src/components/schemas/file.yaml index 862e1c120..54e666f06 100644 --- a/src/components/schemas/file.yaml +++ b/src/components/schemas/file.yaml @@ -1,6 +1,17 @@ file_out: type: object additionalProperties: false + required: + - id + - org_id + - user_id + - created_at + - updated_at + - name + - type + - content_type + - download_url + - upload_url properties: id: $ref: './fields.yaml#/id_string' @@ -43,6 +54,8 @@ file_out: file_generate_urls_action_in: type: object + required: + - id properties: id: $ref: './fields.yaml#/id_string' @@ -51,6 +64,12 @@ file_generate_urls_action_in: file_generate_urls_action_out: type: object additionalProperties: false + required: + - id + - name + - content_type + - download_url + - upload_url properties: id: $ref: './fields.yaml#/id_string' @@ -76,6 +95,11 @@ file_generate_urls_action_out: file_out_embed: type: object + required: + - id + - name + - type + - content_type properties: id: allOf: @@ -162,6 +186,11 @@ file_delete_action_in: file_out_download_url: type: object additionalProperties: false + required: + - id + - name + - content_type + - download_url properties: id: $ref: './fields.yaml#/id_string' diff --git a/src/components/schemas/invitation.yaml b/src/components/schemas/invitation.yaml index 1ff91df21..dc3291262 100644 --- a/src/components/schemas/invitation.yaml +++ b/src/components/schemas/invitation.yaml @@ -51,13 +51,23 @@ invitation_in: example: Branch Manager custom_fields: $ref: './fields.yaml#/custom_fields' + roles: + type: array + nullable: False + items: + $ref: './fields.yaml#/role' + example: [ 'FYLER', 'APPROVER' ] + description: | + List of roles for this employee approver_emails: type: array maxItems: 3 nullable: False items: - $ref: './fields.yaml#/email' + anyOf: + - $ref: './fields.yaml#/email' + - $ref: './fields.yaml#/null_field' example: [ 'approver1@example.com', 'approver2@example.com', null ] description: | List of emails of employees that are approvers for this employee. Use null in case of no approver or to remove the approver. diff --git a/src/components/schemas/level.yaml b/src/components/schemas/level.yaml index 73a07a96e..4d38ba007 100644 --- a/src/components/schemas/level.yaml +++ b/src/components/schemas/level.yaml @@ -97,3 +97,37 @@ level_in: required: - name - is_enabled + + +level_in_only_id: + type: object + required: + - id + additionalProperties: False + properties: + id: + $ref: './fields.yaml#/id_string' + + +level_delete_summary_out: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: object + additionalProperties: False + properties: + delete_count: + type: integer + description: Count of levels that can be deleted from the supplied levels. + example: 2 + levels: + type: array + description: Levels that can be deleted. + example: + - id: lvlTqSvgYSlMk + - id: lvlISw67iupk3 + items: + $ref: './level.yaml#/level_in_only_id' diff --git a/src/components/schemas/merchant.yaml b/src/components/schemas/merchant.yaml index ba4ba3e48..dd90ece22 100644 --- a/src/components/schemas/merchant.yaml +++ b/src/components/schemas/merchant.yaml @@ -1,6 +1,11 @@ merchant_out: type: object additionalProperties: false + required: + - id + - created_at + - updated_at + - display_name properties: id: $ref: './fields.yaml#/id_integer' @@ -17,6 +22,12 @@ merchant_out: approver_merchant_out: type: object additionalProperties: false + required: + - id + - org_id + - created_at + - updated_at + - display_name properties: id: $ref: './fields.yaml#/id_integer' diff --git a/src/components/schemas/mileage_rate.yaml b/src/components/schemas/mileage_rate.yaml index ccf066916..211af4637 100644 --- a/src/components/schemas/mileage_rate.yaml +++ b/src/components/schemas/mileage_rate.yaml @@ -1,6 +1,22 @@ mileage_rate_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - unit + - vehicle_type + - rate + - slab_rates + - is_enabled + - code + - vehicle_ownership + - vehicle_category + - fuel_type + - engine_capacity + - charging_location properties: id: $ref: './fields.yaml#/id_integer' @@ -31,6 +47,9 @@ mileage_rate_out: type: array items: type: object + required: + - rate + - limit properties: rate: type: number @@ -42,11 +61,67 @@ mileage_rate_out: $ref: ./fields.yaml#/is_enabled code: $ref: ./fields.yaml#/code + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Vehicle ownership for advanced mileage rates. `null` for basic mileage rates. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Vehicle category for advanced mileage rates. `null` for basic mileage rates. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Fuel type for advanced car mileage rates. `null` otherwise. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Engine capacity band for petrol, diesel, and LPG advanced car rates. An empty object for basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Charging location for advanced electric car mileage rates. `null` otherwise. mileage_rate_out_embed: type: object nullable: true additionalProperties: False + required: + - id + - vehicle_type + - code properties: id: $ref: './fields.yaml#/id_integer' @@ -60,6 +135,11 @@ mileage_rate_out_embed_for_expense: type: object nullable: true additionalProperties: False + required: + - id + - vehicle_type + - code + - rate properties: id: $ref: './fields.yaml#/id_integer' @@ -73,6 +153,58 @@ mileage_rate_out_embed_for_expense: example: 10.0 nullable: true description: Amount (in Home currency) per unit. + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Vehicle ownership for advanced mileage rates. `null` for basic mileage rates. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Vehicle category for advanced mileage rates. `null` for basic mileage rates. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Fuel type for advanced car mileage rates. `null` otherwise. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Engine capacity band for petrol, diesel, and LPG advanced car rates. An empty object for basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Charging location for advanced electric car mileage rates. `null` otherwise. mileage_rate_in: type: object @@ -81,6 +213,11 @@ mileage_rate_in: - rate - vehicle_type - is_enabled + - vehicle_ownership + - vehicle_category + - fuel_type + - engine_capacity + - charging_location properties: id: $ref: './fields.yaml#/id_integer' @@ -99,10 +236,12 @@ mileage_rate_in: rate: type: number example: 10.0 - nullable: true + minimum: 0 + exclusiveMinimum: true description: Amount (in Home currency) per unit. slab_rates: type: array + maxItems: 1 items: type: object required: @@ -111,11 +250,95 @@ mileage_rate_in: properties: rate: type: number - nullable: true limit: type: number - nullable: true is_enabled: $ref: ./fields.yaml#/is_enabled code: - $ref: ./fields.yaml#/code \ No newline at end of file + $ref: ./fields.yaml#/code + vehicle_ownership: + type: string + nullable: true + enum: + - PERSONAL + - COMPANY + - null + description: Optional. Use `null` for a basic mileage rate; an advanced rate requires a non-null value. + vehicle_category: + type: string + nullable: true + enum: + - CAR + - MOTORCYCLE + - BICYCLE + - null + description: Optional. Use `null` for a basic mileage rate; an advanced rate requires a non-null value. + fuel_type: + type: string + nullable: true + enum: + - PETROL + - DIESEL + - LPG + - ELECTRIC + - null + description: Optional. Use `null` for motorcycles, bicycles, and basic mileage rates. + engine_capacity: + type: object + nullable: true + additionalProperties: false + description: Optional. Use an empty object for electric and basic mileage rates. + properties: + from: + type: string + nullable: true + example: '0' + to: + type: string + nullable: true + example: '1400' + unit: + type: string + example: cc + charging_location: + type: string + nullable: true + enum: + - HOME + - PUBLIC + - null + description: Optional. Use `null` unless the rate is an advanced electric car. + +mileage_rate_in_only_id: + type: object + required: + - id + additionalProperties: False + properties: + id: + $ref: './fields.yaml#/id_integer' + +mileage_rate_delete_summary_out: + type: object + required: + - data + additionalProperties: False + properties: + data: + type: object + required: + - delete_count + - mileage_rates + properties: + delete_count: + type: integer + description: Count of mileage rates that could be deleted from input mileage rates. + example: 2 + mileage_rates: + type: array + description: Mileage rates that could be deleted. + example: + - id: 9080 + - id: 9081 + items: + $ref: './mileage_rate.yaml#/mileage_rate_in_only_id' diff --git a/src/components/schemas/mobile_app_version.yaml b/src/components/schemas/mobile_app_version.yaml new file mode 100644 index 000000000..41e2a6511 --- /dev/null +++ b/src/components/schemas/mobile_app_version.yaml @@ -0,0 +1,55 @@ +mobile_app_version_out: + type: object + additionalProperties: false + required: + - id + - user_id + - version + - os + - created_at + - updated_at + properties: + id: + type: string + description: Unique identifier for the mobile app version entry + example: appXYZ1234567 + user_id: + $ref: ./fields.yaml#/user_id + version: + type: string + description: Mobile app version + example: "8.0.1" + os: + $ref: '#/os' + created_at: + $ref: ./fields.yaml#/created_at + updated_at: + $ref: ./fields.yaml#/updated_at + +mobile_app_version_in: + type: object + additionalProperties: false + required: + - version + - os + properties: + version: + type: string + description: Mobile app version + example: "8.0.1" + os: + $ref: '#/os' + +os: + type: object + additionalProperties: false + properties: + name: + type: string + enum: [IOS, ANDROID] + description: Operating system name + example: IOS + version: + type: string + description: Operating system version + example: "17.0.0" diff --git a/src/components/schemas/my_profile.yaml b/src/components/schemas/my_profile.yaml index 79d292e1e..a5880739a 100644 --- a/src/components/schemas/my_profile.yaml +++ b/src/components/schemas/my_profile.yaml @@ -1,6 +1,12 @@ my_profile_out: type: object additionalProperties: false + required: + - user_id + - org_id + - org + - user + - roles properties: user_id: $ref: '../../components/schemas/fields.yaml#/user_id' diff --git a/src/components/schemas/org.yaml b/src/components/schemas/org.yaml index c57da5664..aabc8bcff 100644 --- a/src/components/schemas/org.yaml +++ b/src/components/schemas/org.yaml @@ -1,6 +1,41 @@ +org_weekly_invitation_usage_out: + type: object + additionalProperties: false + required: + - id + - invitation_sent + - is_limit_reached + - weekly_limit + properties: + id: + $ref: './fields.yaml#/org_id' + weekly_limit: + type: integer + nullable: true + description: | + The maximum number of employee invitations allowed per week. + This is `null` when the organisation is within its onboarding period and no limit applies. + example: 50 + invitation_sent: + type: integer + description: | + The number of successful employee invitations sent during the current calendar week. + example: 12 + is_limit_reached: + type: boolean + description: | + Indicates whether the weekly invitation limit has been reached. + Always `false` when `weekly_limit` is `null`. + example: false + org_out_embed: type: object additionalProperties: False + required: + - id + - name + - domain + - currency properties: id: $ref: './fields.yaml#/org_id' @@ -26,6 +61,8 @@ org_out: - currency - created_at - updated_at + - is_current + - is_primary properties: id: $ref: './fields.yaml#/org_id' @@ -145,6 +182,15 @@ org_reset_delete_in: get_spender_orgs_out: type: object additionalProperties: False + required: + - id + - name + - domain + - currency + - created_at + - updated_at + - is_current + - is_primary properties: id: $ref: './fields.yaml#/org_id' @@ -173,6 +219,12 @@ get_spender_orgs_out: org_bank_details_out: type: object additionalProperties: false + required: + - org_id + - bank_account_number + - bank_branch_ifsc + - dwolla_customers_metadata_id + - is_bank_account_added properties: org_id: $ref: './fields.yaml#/org_id' @@ -201,6 +253,9 @@ org_bank_details_out: spender_org_bank_details_out: type: object additionalProperties: false + required: + - org_id + - is_bank_account_added properties: org_id: $ref: './fields.yaml#/org_id' diff --git a/src/components/schemas/org_settings.yaml b/src/components/schemas/org_settings.yaml index f1f8cfa54..8af0054f7 100644 --- a/src/components/schemas/org_settings.yaml +++ b/src/components/schemas/org_settings.yaml @@ -1,5 +1,10 @@ logo_file_generate_download_url_action_out: type: object + required: + - id + - name + - content_type + - download_url additionalProperties: false properties: id: diff --git a/src/components/schemas/per_diem_rate.yaml b/src/components/schemas/per_diem_rate.yaml index 7cd67f415..61033cd2b 100644 --- a/src/components/schemas/per_diem_rate.yaml +++ b/src/components/schemas/per_diem_rate.yaml @@ -1,6 +1,17 @@ per_diem_rate_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - is_enabled + - name + - currency + - rate + - code + - description properties: id: $ref: './fields.yaml#/id_integer' @@ -35,6 +46,10 @@ per_diem_rate_out_embed: type: object nullable: true additionalProperties: False + required: + - id + - name + - code properties: id: $ref: './fields.yaml#/id_integer' @@ -72,3 +87,39 @@ per_diem_rate_in: type: number example: 10.0 description: Amount per night + + +per_diem_rate_in_only_id: + type: object + required: + - id + additionalProperties: False + properties: + id: + $ref: './fields.yaml#/id_integer' + + +per_diem_rate_delete_summary_out: + type: object + additionalProperties: False + required: + - data + properties: + data: + type: object + required: + - delete_count + - per_diem_rates + properties: + delete_count: + type: integer + description: Count of per diem rates that could be deleted from input per diem rates. + example: 2 + per_diem_rates: + type: array + description: Per diem rates that could be deleted. + example: + - id: 1234 + - id: 4567 + items: + $ref: './per_diem_rate.yaml#/per_diem_rate_in_only_id' diff --git a/src/components/schemas/personal_card.yaml b/src/components/schemas/personal_card.yaml index 7c0e9c65e..4c8ae8ccc 100644 --- a/src/components/schemas/personal_card.yaml +++ b/src/components/schemas/personal_card.yaml @@ -1,5 +1,7 @@ personal_card_access_token_out: type: object + required: + - access_token properties: access_token: type: string @@ -20,6 +22,8 @@ personal_card_mfa_in: personal_card_mfa_out: type: object + required: + - is_mfa_enabled properties: is_mfa_enabled: type: boolean @@ -30,6 +34,10 @@ personal_card_mfa_out: fastlink_params: type: object + required: + - configName + - flow + - providerAccountId nullable: true additionalProperties: False properties: @@ -55,6 +63,23 @@ fastlink_params: personal_card_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - card_number + - bank_name + - currency + - account_type + - yodlee_account_id + - yodlee_login_id + - yodlee_last_synced_at + - yodlee_is_mfa_required + - yodlee_fastlink_params + - yodlee_is_credential_update_required + - yodlee_provider_account_id properties: id: $ref: './fields.yaml#/id_string' @@ -82,10 +107,6 @@ personal_card_out: $ref: './fields.yaml#/fk_string' yodlee_fastlink_params: $ref: '#/fastlink_params' - type: object - nullable: true - description: | - Configuration to open Yodlee Fastlink yodlee_is_credential_update_required: type: boolean nullable: false @@ -121,6 +142,23 @@ personal_card_out: personal_card_delete_out: type: object additionalProperties: false + required: + - id + - org_id + - user_id + - currency + - bank_name + - card_number + - account_type + - yodlee_account_id + - yodlee_fastlink_params + - yodlee_is_credential_update_required + - yodlee_is_mfa_required + - yodlee_last_synced_at + - yodlee_login_id + - yodlee_provider_account_id + - created_at + - updated_at properties: id: $ref: './fields.yaml#/id_string' diff --git a/src/components/schemas/personal_card_transaction.yaml b/src/components/schemas/personal_card_transaction.yaml index 4eeaa34d1..db941b98a 100644 --- a/src/components/schemas/personal_card_transaction.yaml +++ b/src/components/schemas/personal_card_transaction.yaml @@ -1,5 +1,24 @@ personal_card_transaction_out: type: object + required: + - id + - org_id + - user_id + - personal_card_id + - amount + - currency + - spent_at + - category + - merchant + - state + - description + - external_transaction_id + - matched_expense_ids + - created_at + - updated_at + - foreign_amount + - foreign_currency + - matched_expenses additionalProperties: False properties: id: @@ -76,6 +95,17 @@ matched_expense_out_embed: type: object nullable: true additionalProperties: false + required: + - amount + - category_display_name + - currency + - seq_num + - id + - no_of_files + - purpose + - state + - spent_at + - merchant properties: amount: $ref: './fields.yaml#/amount' @@ -143,6 +173,8 @@ personal_card_transaction_expense_suggestions: additionalProperties: False personal_card_transactions_stats_in: + required: + - query_params properties: query_params: nullable: false @@ -154,6 +186,10 @@ personal_card_transactions_stats_in: personal_card_transactions_stats_out: type: object + required: + - count + - debit_amount + - credit_amount properties: count: type: integer diff --git a/src/components/schemas/place.yaml b/src/components/schemas/place.yaml index d62bfd837..8ade16b2d 100644 --- a/src/components/schemas/place.yaml +++ b/src/components/schemas/place.yaml @@ -1,6 +1,14 @@ place_out: type: object additionalProperties: false + required: + - id + - city + - state + - country + - formatted_address + - latitude + - longitude properties: id: type: string @@ -28,6 +36,9 @@ place_out: place_out_minimal: type: object + required: + - id + - formatted_address properties: id: type: string diff --git a/src/components/schemas/policy.yaml b/src/components/schemas/policy.yaml index 9893061f8..796ea059a 100644 --- a/src/components/schemas/policy.yaml +++ b/src/components/schemas/policy.yaml @@ -1,6 +1,9 @@ policy_test_out: type: object additionalProperties: false + required: + - policy_violation_summary + - policy_violations properties: policy_violation_summary: type: object diff --git a/src/components/schemas/project.yaml b/src/components/schemas/project.yaml index 8b3de6b55..a1723bcfb 100644 --- a/src/components/schemas/project.yaml +++ b/src/components/schemas/project.yaml @@ -1,6 +1,19 @@ project_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - sub_project + - display_name + - is_enabled + - code + - description + - category_ids + - default_billable properties: id: $ref: './fields.yaml#/id_integer' @@ -43,11 +56,23 @@ project_out: type: integer example: 16570 description: List of categories that are applicable for the project. + default_billable: + type: boolean + nullable: true + description: | + Default billable flag for expenses using this project. + `null` indicates the default is not set. project_out_embed: type: object nullable: true additionalProperties: False + required: + - id + - name + - sub_project + - code + - display_name properties: id: $ref: './fields.yaml#/id_integer' @@ -153,6 +178,13 @@ project_in: - `null` value indicates that all categories in the org are applicable for the project. - `[]` value indicates that no category in the org is applicable for the project. - The default value of `category_ids` is `null` + default_billable: + type: boolean + nullable: true + description: | + Default billable flag for expenses using this project. + `null` indicates the default is not set. + example: true project_in_only_id: type: object @@ -166,6 +198,22 @@ project_in_only_id: admin_approver_project_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - name + - sub_project + - display_name + - is_enabled + - code + - description + - restricted_spender_user_ids + - approver_user_ids + - approver_users + - category_ids + - default_billable properties: id: $ref: './fields.yaml#/id_integer' @@ -217,13 +265,24 @@ admin_approver_project_out: type: integer example: 16570 description: List of categories that are applicable for the project. + default_billable: + type: boolean + nullable: true + description: | + Default billable flag for expenses using this project. + `null` indicates the default is not set. project_delete_summary_out: type: object + required: + - data additionalProperties: False properties: data: type: object + required: + - delete_count + - projects properties: delete_count: type: integer diff --git a/src/components/schemas/recently_used_fields.yaml b/src/components/schemas/recently_used_fields.yaml index 4fb18e5de..284358813 100644 --- a/src/components/schemas/recently_used_fields.yaml +++ b/src/components/schemas/recently_used_fields.yaml @@ -1,6 +1,17 @@ recently_used_fields_out: type: object additionalProperties: false + required: + - org_id + - user_id + - category_ids + - cost_center_ids + - project_ids + - start_locations + - locations + - end_locations + - vehicle_types + - currencies properties: user_id: diff --git a/src/components/schemas/reconciliation_eligible_cards.yaml b/src/components/schemas/reconciliation_eligible_cards.yaml index 1bbf0b7b9..584c27a41 100644 --- a/src/components/schemas/reconciliation_eligible_cards.yaml +++ b/src/components/schemas/reconciliation_eligible_cards.yaml @@ -7,6 +7,7 @@ reconciliation_eligible_card_out: - reconciliation_entry_id - card_number - card_nickname + - is_archived - user - reconciled_on - statement_transaction_count @@ -15,6 +16,8 @@ reconciliation_eligible_card_out: - expense_total - matching_issue_count - status + - created_at + - updated_at properties: created_at: $ref: './fields.yaml#/created_at' @@ -38,6 +41,10 @@ reconciliation_eligible_card_out: maxLength: 25 description: Unique nickname assigned to the card. example: Business Card + is_archived: + type: boolean + description: Indicate whether the card is archived. + example: false user: $ref: './user.yaml#/user_out_embed_nullable' reconciled_on: @@ -77,6 +84,8 @@ reconciliation_eligible_card_out: $ref: './fields.yaml#/updated_at' reconciliation_eligible_cards_stats_in: + required: + - query_params properties: query_params: nullable: False @@ -88,6 +97,21 @@ reconciliation_eligible_cards_stats_in: reconciliation_eligible_cards_stats_out: type: object + required: + - period_start + - period_end + - statement_transaction_count + - expense_count + - statement_total + - expense_total + - difference + - matching_issue_count + - total_cards + - card_without_statement_count + - card_with_matching_issue_count + - card_with_no_issues_found_count + - card_with_no_transactions_count + - reconciled_card_count additionalProperties: False properties: period_start: @@ -139,6 +163,14 @@ reconciliation_eligible_cards_stats_out: type: integer description: Number of cards that have only matching issues. example: 0 + card_with_no_issues_found_count: + type: integer + description: Number of cards that have no matching issues found. + example: 0 + card_with_no_transactions_count: + type: integer + description: Number of cards that have no transactions in the period. + example: 0 reconciled_card_count: type: integer description: Number of cards that are reconciled. diff --git a/src/components/schemas/reconciliation_entry.yaml b/src/components/schemas/reconciliation_entry.yaml index 0e4e10900..b32d0754c 100644 --- a/src/components/schemas/reconciliation_entry.yaml +++ b/src/components/schemas/reconciliation_entry.yaml @@ -1,6 +1,21 @@ reconciliation_entry_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - period_start + - period_end + - status + - reconciled_on + - reconciled_by + - bridging_entry_change_type + - statement_transaction_count + - expense_count + - statement_total + - expense_total properties: id: type: string diff --git a/src/components/schemas/reconciliation_exports.yaml b/src/components/schemas/reconciliation_exports.yaml new file mode 100644 index 000000000..fd9d42fb0 --- /dev/null +++ b/src/components/schemas/reconciliation_exports.yaml @@ -0,0 +1,147 @@ +# Shared config for reconciliation exports (eligible cards and transactions) +reconciliation_export_config_column_formula: + type: object + properties: + function: + type: string + example: Field + parameters: + type: array + items: + anyOf: + - type: object + - type: string + - type: number + - type: integer + - type: boolean + description: | + Export column formula used to transform the data. + +reconciliation_export_config: + type: object + additionalProperties: true + required: + - type + - is_header_visible + - columns + properties: + type: + type: string + enum: + - xlsx + - csv + description: Type of the export file. + example: csv + is_header_visible: + type: boolean + description: Whether to show the header in the export file. + example: true + separate_line_items_entry: + type: object + nullable: true + properties: + enabled: + type: boolean + description: Whether to show the double rows for each line item in the export file. + debit_entries_only: + type: array + items: + type: string + description: Configure which columns to show for debit entries. + credit_entries_only: + type: array + items: + type: string + description: Configure which columns to show for credit entries. + description: Configure how to show the double rows for each line item, if enabled. + columns: + type: array + items: + type: object + properties: + name: + type: string + description: Name of the column. + formula: + $ref: '#/reconciliation_export_config_column_formula' + required: + - name + - formula + description: Configure the columns to show in the export file. + +reconciliation_export_in: + type: object + additionalProperties: false + required: + - query_params + - notify_emails + - config + properties: + query_params: + type: string + nullable: false + description: | + Query param string similar to the GET list API for the resource (eligible cards or transactions). + For eligible cards export use e.g. reconciliation_entry_id=eq.. + For transactions export use e.g. reconciliation_entry_id=eq.. + example: reconciliation_entry_id=eq.rece_seed_2 + notify_emails: + type: array + nullable: false + items: + $ref: './fields.yaml#/email' + description: List of emails to notify when the export is ready. + config: + $ref: '#/reconciliation_export_config' + nullable: false + description: Configuration for the export. + +reconciliation_export_out: + type: object + additionalProperties: false + required: + - id + - org_id + - file_id + - state + - query_params + - notify_emails + - created_at + - updated_at + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + description: Unique id of the export. + org_id: + $ref: './fields.yaml#/org_id' + file_id: + anyOf: + - $ref: './fields.yaml#/null_field' + - $ref: './fields.yaml#/id_string' + nullable: true + description: File id when export is completed (null while pending/processing). + state: + type: string + nullable: false + enum: + - PENDING + - PROCESSING + - SUCCESS + - ERROR + description: Status of the export. + example: PENDING + query_params: + type: string + nullable: false + description: Query params used for this export. + notify_emails: + type: array + nullable: false + items: + $ref: './fields.yaml#/email' + description: List of emails to notify when the export is ready. + created_at: + $ref: './fields.yaml#/created_at' + updated_at: + $ref: './fields.yaml#/updated_at' diff --git a/src/components/schemas/reconciliation_transactions.yaml b/src/components/schemas/reconciliation_transactions.yaml index d2b5d7923..27946a54f 100644 --- a/src/components/schemas/reconciliation_transactions.yaml +++ b/src/components/schemas/reconciliation_transactions.yaml @@ -11,6 +11,12 @@ reconciliation_transaction_out: - matched_expenses_count - is_reconciled - expenses + - statement_line_item_id + - expense_ids + - statement_transaction_date + - statement_post_date + - created_at + - updated_at properties: id: $ref: './fields.yaml#/id_string' @@ -86,6 +92,12 @@ reconciliation_expense_split_out_embed: - amount - state - purpose + - currency + - merchant + - spent_at + - file_ids + - category + - project properties: id: allOf: @@ -149,6 +161,29 @@ reconciliation_expense_split_out_embed: nullable: true example: Team lunch description: Purpose or description of this split line. + matched_corporate_card_transaction: + type: object + nullable: true + description: Matched corporate card transaction details for this expense, if any. + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: btxnwownwrng + description: Id of the matched corporate card transaction. + status: + type: string + enum: + - PENDING + - POSTED + description: Status of the matched corporate card transaction. + example: POSTED + files: + type: array + nullable: true + description: List of files attached to this expense split. + items: + $ref: './file.yaml#/file_out_embed' reconciliation_matched_expense_out_embed: type: object @@ -164,6 +199,7 @@ reconciliation_matched_expense_out_embed: - project - purpose - splits + - currency properties: id: allOf: @@ -229,6 +265,29 @@ reconciliation_matched_expense_out_embed: nullable: true example: Team lunch description: Purpose or description of the expense. + matched_corporate_card_transaction: + type: object + nullable: true + description: Matched corporate card transaction details for this expense, if any. + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: btxnwownwrng + description: Id of the matched corporate card transaction. + status: + type: string + enum: + - PENDING + - POSTED + description: Status of the matched corporate card transaction. + example: POSTED + files: + type: array + nullable: true + description: List of files attached to this expense. + items: + $ref: './file.yaml#/file_out_embed' splits: type: array nullable: true @@ -243,6 +302,8 @@ reconciliation_transactions_stats_in: Input to fetch reconciliation transactions stats for a specific card or filter. Pass filters using the `query_params` string similar to the GET list API. For example, filter by a single card using `corporate_card_id=eq.`. + required: + - query_params properties: query_params: type: string @@ -253,6 +314,15 @@ reconciliation_transactions_stats_in: reconciliation_transactions_stats_out: type: object + required: + - period_start + - period_end + - statement_transaction_count + - expense_count + - statement_total + - expense_total + - difference + - matching_issue_count additionalProperties: False description: | Reconciliation transactions statistics for the selected filter period. diff --git a/src/components/schemas/recurring_expense.yaml b/src/components/schemas/recurring_expense.yaml index 9f1a8c742..7821dd546 100644 --- a/src/components/schemas/recurring_expense.yaml +++ b/src/components/schemas/recurring_expense.yaml @@ -49,6 +49,8 @@ recurring_expense_out: - expense_details - schedule_config - is_enabled + - created_at + - updated_at properties: id: allOf: @@ -71,8 +73,8 @@ recurring_expense_out: - MILEAGE: Mileage-based expense type example: EXPENSE expense_details: - type: object - nullable: false + allOf: + - $ref: './expense.yaml#/spender_expense_in' description: | Expense template details used for creating recurring expenses. Contains all the expense fields that will be applied to each generated expense. diff --git a/src/components/schemas/reimbursement.yaml b/src/components/schemas/reimbursement.yaml index 91eba1bba..27b9471b8 100644 --- a/src/components/schemas/reimbursement.yaml +++ b/src/components/schemas/reimbursement.yaml @@ -1,6 +1,24 @@ reimbursement_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - creator_user_id + - user_id + - org_id + - reimbursement_number + - amount + - currency + - purpose + - mode + - is_paid + - paid_at + - is_exported + - code + - employee_id + - employee properties: id: type: string @@ -84,12 +102,16 @@ reimbursement_out: reimbursement_in: type: object + required: + - amount properties: amount: $ref: './fields.yaml#/amount' reimbursement_in_minimal: type: object + required: + - id properties: id: type: string @@ -104,6 +126,12 @@ reimbursement_in_minimal: reimbursement_out_minimal: type: object nullable: true + required: + - id + - currency + - amount + - mode + - ach_transfer properties: id: type: string diff --git a/src/components/schemas/reminder.yaml b/src/components/schemas/reminder.yaml index 7d1d36f03..4565d1e49 100644 --- a/src/components/schemas/reminder.yaml +++ b/src/components/schemas/reminder.yaml @@ -1,6 +1,19 @@ reminder_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - type + - message + - schedule_config + - add_to_calendar + - receiver_user_ids + - send_mobile_notification + - last_reminded_at + - next_reminder_at properties: id: type: string @@ -44,6 +57,13 @@ reminder_out: description: | Determines whether this reminder will be added as an event in the google calendar of receiver. example: true + send_mobile_notification: + type: boolean + nullable: false + default: false + description: | + Determines whether this reminder will be used to send mobile notification + example: true receiver_user_ids: $ref: ./fields.yaml#/reminder_receiver_user_ids @@ -52,6 +72,12 @@ reminder_out: reminder_in: type: object additionalProperties: False + required: + - type + - message + - schedule_config + - add_to_calendar + - receiver_user_ids properties: id: type: string @@ -75,6 +101,13 @@ reminder_in: description: | Determines whether this reminder will be added as an event in the google calendar of receiver. example: true + send_mobile_notification: + type: boolean + nullable: false + default: false + description: | + Determines whether this reminder will be used to send mobile notification + example: true receiver_user_ids: $ref: ./fields.yaml#/reminder_receiver_user_ids @@ -91,6 +124,8 @@ reminder_delete_in: example: 'remindNZgN7V5pft' reminders_stats_in: + required: + - query_params properties: query_params: type: string @@ -103,6 +138,9 @@ reminders_stats_out: type: array items: type: object + required: + - last_reminded_at + - type properties: last_reminded_at: type: string diff --git a/src/components/schemas/report.yaml b/src/components/schemas/report.yaml index 1efc1f4c3..b62a118f9 100644 --- a/src/components/schemas/report.yaml +++ b/src/components/schemas/report.yaml @@ -28,6 +28,16 @@ report_out: - reimbursement_id - reimbursement - comments + - creator_type + - is_verified + - is_physical_bill_submitted + - physical_bill_submitted_at + - is_exported + - employee_id + - state_display_name + - accounting_export_summary + - applied_advance_wallets + - auto_approval_state properties: id: $ref: ./fields.yaml#/id_string @@ -227,6 +237,23 @@ report_out: nullable: true description: | List of applied advance wallets + creator_type: + type: string + enum: + - USER + - SYSTEM + description: | + Indicates whether the report was created by a user or the system. + example: USER + auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null admin_report_out: type: object @@ -260,6 +287,15 @@ admin_report_out: - comments - applied_advance_wallets - can_apply_advances + - creator_type + - is_verified + - is_physical_bill_submitted + - physical_bill_submitted_at + - is_exported + - employee_id + - state_display_name + - accounting_export_summary + - auto_approval_state properties: id: $ref: ./fields.yaml#/id_string @@ -464,6 +500,23 @@ admin_report_out: nullable: true description: | List of applied advance wallets + creator_type: + type: string + enum: + - USER + - SYSTEM + description: | + Indicates whether the report was created by a user or the system. + example: USER + auto_approval_state: + type: string + nullable: true + description: Indicates the auto approval evaluation status of the report. + enum: + - PENDING + - NOT_ELIGIBLE + - AUTO_APPROVED + - null admin_report_in: type: object @@ -525,6 +578,9 @@ report_out_embed: - last_paid_at - reimbursement_id - reimbursement_seq_num + - amount + - last_verified_at + - approvals properties: id: anyOf: @@ -901,6 +957,26 @@ process_ach_in: required: - id +revert_to_processing_in: + type: object + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: rp13tP1HVeqa + required: + - id + +revert_to_approved_in: + type: object + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: rp13tP1HVeqa + required: + - id + mark_paid_bulk_in: type: object required: @@ -942,6 +1018,20 @@ process_summary_in: process_summary_out: type: object + required: + - selected_reimbursable_amount + - selected_count + - unverified_count + - unverified_amount + - missing_bank_details_count + - missing_bank_details_amount + - missing_bank_details_employee_count + - missing_bank_details_employee_ids + - payment_initiated_amount + - payment_initiated_count + - reimbursable_amount + - reimbursable_report_ids + - closable_report_ids additionalProperties: True properties: selected_reimbursable_amount: @@ -1026,6 +1116,8 @@ process_summary_out: reports_stats_in: + required: + - query_params properties: query_params: type: string diff --git a/src/components/schemas/report_approval.yaml b/src/components/schemas/report_approval.yaml index 1e3d4c51d..7c850ffd4 100644 --- a/src/components/schemas/report_approval.yaml +++ b/src/components/schemas/report_approval.yaml @@ -1,13 +1,34 @@ report_approval_out_embed: type: object additionalProperties: False + required: + - approver_user_id + - approver_user + - state properties: approver_user_id: allOf: - $ref: ./fields.yaml#/id_string + nullable: true + description: | + The user ID of the approver. This is null when approver_type is SYSTEM (auto-approval). example: usge49ielgel + approver_type: + type: string + enum: + - USER + - SYSTEM + description: | + Type of approver. + - USER: A human approver identified by approver_user_id + - SYSTEM: Automatic approval by the system (auto-approval feature). When approver_type is SYSTEM, approver_user_id is null. + example: USER approver_user: - $ref: ./user.yaml#/user_out_embed + allOf: + - $ref: ./user.yaml#/user_out_embed + nullable: true + description: | + The user object of the approver. This is null when approver_type is SYSTEM. state: type: string enum: diff --git a/src/components/schemas/report_filters.yaml b/src/components/schemas/report_filters.yaml index b0acfc75e..3311fc3d2 100644 --- a/src/components/schemas/report_filters.yaml +++ b/src/components/schemas/report_filters.yaml @@ -18,6 +18,16 @@ report_filters_in: report_filters_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - is_shared + - name + - org_id + - query_string + - user_id + - sub_feature properties: id: allOf: diff --git a/src/components/schemas/reports_export_configurations.yaml b/src/components/schemas/reports_export_configurations.yaml index 08d5ad76a..43ef02a2d 100644 --- a/src/components/schemas/reports_export_configurations.yaml +++ b/src/components/schemas/reports_export_configurations.yaml @@ -37,6 +37,10 @@ reports_export_configuration_column: reports_export_configuration_sort_column: type: object + required: + - display_name + - field_name + - direction properties: display_name: type: string @@ -159,9 +163,9 @@ reports_export_configuration_in: Configuration details for the export including columns, sorting, and formatting options. required: - name - - query_string - type - config + - sub_feature reports_export_configuration_in_only_id: @@ -177,6 +181,17 @@ reports_export_configuration_in_only_id: reports_export_configuration_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - name + - query_string + - sub_feature + - config + - type + - org_id + - user_id properties: id: allOf: @@ -192,16 +207,6 @@ reports_export_configuration_out: $ref: './fields.yaml#/created_at' updated_at: $ref: './fields.yaml#/updated_at' - created_by: - allOf: - - $ref: './user.yaml#/user_out_embed_nullable' - description: | - User who created this export configuration. - updated_by: - allOf: - - $ref: './user.yaml#/user_out_embed_nullable' - description: | - User who last updated this export configuration. name: type: string description: | diff --git a/src/components/schemas/reports_exports.yaml b/src/components/schemas/reports_exports.yaml index 593542788..7c6145a6b 100644 --- a/src/components/schemas/reports_exports.yaml +++ b/src/components/schemas/reports_exports.yaml @@ -1,5 +1,8 @@ reports_export_config_column_formula: type: object + required: + - function + - parameters properties: function: type: string @@ -26,6 +29,8 @@ reports_export_config_column_formula: reports_export_config: type: object additionalProperties: true + required: + - type properties: type: type: string @@ -48,6 +53,10 @@ reports_export_config: example: true separate_line_items_entry: type: object + required: + - enabled + - debit_entries_only + - credit_entries_only properties: enabled: type: boolean @@ -74,6 +83,9 @@ reports_export_config: type: array items: type: object + required: + - name + - formula properties: name: type: string @@ -119,6 +131,17 @@ reports_exports_in: reports_exports_out: type: object additionalProperties: false + required: + - created_at + - updated_at + - id + - org_id + - user_id + - file_id + - state + - query_params + - notify_emails + - config properties: created_at: $ref: './fields.yaml#/created_at' diff --git a/src/components/schemas/schedule.yaml b/src/components/schemas/schedule.yaml index 794154f47..db32e249a 100644 --- a/src/components/schemas/schedule.yaml +++ b/src/components/schemas/schedule.yaml @@ -1,5 +1,7 @@ schedule_in: type: object + required: + - is_enabled properties: id: $ref: './fields.yaml#/id_string' @@ -18,6 +20,14 @@ schedule_in: schedule_out: type: object additionalProperties: False + required: + - id + - created_at + - updated_at + - config + - org_id + - user_id + - is_enabled properties: id: $ref: './fields.yaml#/id_string' diff --git a/src/components/schemas/scheduled_callback.yaml b/src/components/schemas/scheduled_callback.yaml index b34a70971..770ba6ff2 100644 --- a/src/components/schemas/scheduled_callback.yaml +++ b/src/components/schemas/scheduled_callback.yaml @@ -1,5 +1,10 @@ scheduled_callback_in: type: object + required: + - url + - payload + - schedule_config + - is_enabled properties: id: $ref: './fields.yaml#/id_string' @@ -16,6 +21,15 @@ scheduled_callback_in: scheduled_callback_out: type: object additionalProperties: False + required: + - id + - url + - payload + - schedule_config + - is_enabled + - created_at + - updated_at + - org_id properties: id: $ref: './fields.yaml#/id_string' diff --git a/src/components/schemas/secondary_email.yaml b/src/components/schemas/secondary_email.yaml index 24fec25ef..1fd908373 100644 --- a/src/components/schemas/secondary_email.yaml +++ b/src/components/schemas/secondary_email.yaml @@ -13,6 +13,14 @@ secondary_email_in: secondary_email_out: type: object + required: + - id + - email + - is_verified + - org_id + - user_id + - created_at + - updated_at additionalProperties: False properties: id: diff --git a/src/components/schemas/spend_overview.yaml b/src/components/schemas/spend_overview.yaml index 04e186478..939a8af83 100644 --- a/src/components/schemas/spend_overview.yaml +++ b/src/components/schemas/spend_overview.yaml @@ -2,6 +2,9 @@ spend_overview_summary_data_out: type: object nullable: False + required: + - amount + - time_interval_marker properties: amount: $ref: './fields.yaml#/amount' @@ -12,6 +15,11 @@ spend_overview_summary_data_out: spend_overview_by_merchant_data_out: type: object nullable: False + required: + - merchant_name + - amount + - percentage + - change_percentage properties: merchant_name: $ref: './fields.yaml#/merchant' @@ -26,6 +34,12 @@ spend_overview_by_merchant_data_out: spend_overview_by_project_data_out: type: object nullable: False + required: + - project_id + - project_display_name + - amount + - percentage + - change_percentage properties: project_id: $ref: './fields.yaml#/id_integer' @@ -42,6 +56,12 @@ spend_overview_by_project_data_out: spend_overview_by_category_data_out: type: object nullable: False + required: + - category_id + - category_display_name + - amount + - percentage + - change_percentage properties: category_id: $ref: './fields.yaml#/id_integer' @@ -58,6 +78,12 @@ spend_overview_by_category_data_out: spend_overview_by_department_data_out: type: object nullable: False + required: + - department_id + - department_display_name + - amount + - percentage + - change_percentage properties: department_id: $ref: './fields.yaml#/id_string' @@ -74,6 +100,13 @@ spend_overview_by_department_data_out: spend_overview_by_user_data_out: type: object nullable: False + required: + - user_id + - user_full_name + - user_email + - amount + - percentage + - change_percentage properties: user_id: $ref: './fields.yaml#/id_string' @@ -92,6 +125,17 @@ spend_overview_by_user_data_out: spend_overview_by_corporate_card_data_out: type: object nullable: False + required: + - card_id + - card_number + - card_holder_name + - card_nickname + - user_id + - user_full_name + - user_email + - amount + - percentage + - change_percentage properties: card_id: $ref: './fields.yaml#/id_string' @@ -118,6 +162,18 @@ spend_overview_by_corporate_card_data_out: description: | This id provided by Sage Exp Mgmt to identify a user. This can be null if the corporate card is not assigned to any user. example: 'sdfd2391' + user_full_name: + type: string + nullable: true + description: | + Full name of the user assigned to the corporate card. Can be null if card is not assigned. + example: John Doe + user_email: + type: string + nullable: true + description: | + Email of the user assigned to the corporate card. Can be null if card is not assigned. + example: john.doe@example.com amount: $ref: './fields.yaml#/amount' percentage: diff --git a/src/components/schemas/statement_mappings.yaml b/src/components/schemas/statement_mappings.yaml index 85c914c96..26de233c5 100644 --- a/src/components/schemas/statement_mappings.yaml +++ b/src/components/schemas/statement_mappings.yaml @@ -114,30 +114,34 @@ statement_mappings_suggest_out: additionalProperties: False properties: id: - allOf: - - $ref: './fields.yaml#/id_string' + type: string + nullable: true example: stmpwownwrng bank_name: type: string description: | Specifies the bank name of the statement. example: American Express + nullable: true is_debit_positive: type: boolean description: | Specifies the representation of the the amount in the statement, if true then the amount represented by positive sign are debits, and if false then the amount represented by negative sign are debits. example: true + nullable: true transaction_date_column: type: string description: | Specifies the header name of the transaction date column in the statement. example: spent date + nullable: true merchant_column: type: string description: | Specifies the header name of the merchant column in the statement. example: merchant + nullable: true transaction_id_column: type: string description: | @@ -149,11 +153,13 @@ statement_mappings_suggest_out: description: | Specifies the header name of the amount column in the statement. example: amount + nullable: true name: type: string description: | Specifies the mapping name. example: amex_mapping + nullable: true card_number_column: type: string description: | @@ -194,6 +200,17 @@ statement_mappings_suggest_out: Specifies the credit card network used by the card example: VISA nullable: true + org_id: + type: string + nullable: true + created_at: + type: string + format: date-time + nullable: true + updated_at: + type: string + format: date-time + nullable: true required: - id - bank_name @@ -209,4 +226,7 @@ statement_mappings_suggest_out: - description_column - post_date_column - is_auto_created - - card_network \ No newline at end of file + - card_network + - org_id + - created_at + - updated_at \ No newline at end of file diff --git a/src/components/schemas/statements.yaml b/src/components/schemas/statements.yaml index 28b867edc..b05bc384d 100644 --- a/src/components/schemas/statements.yaml +++ b/src/components/schemas/statements.yaml @@ -94,6 +94,9 @@ statements_out: type: array items: type: object + required: + - ids + - duplicate_line_item_statement_id properties: ids: type: array @@ -154,6 +157,7 @@ statements_out: - is_processed - statement_mappings_id + - creator_user card_transaction_from_statement_in: type: object properties: @@ -238,19 +242,12 @@ card_transaction_from_statement_in: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -269,10 +266,17 @@ card_transaction_from_statement_in: - stlisfdfadssd card_mapping: $ref: '#/card_mapping_in' + ignore_archived_cards: + type: boolean + nullable: true + description: | + Controls how transactions associated with archived cards are handled during statement processing: + If true, transactions associated with archived cards are ignored. + If false, the archived cards are unarchived, and their associated transactions are processed. + example: false required: - id - statement_mapping - - ignored_line_item_ids preview_from_statement_in: type: object @@ -284,6 +288,12 @@ preview_from_statement_in: statement_mapping: type: object properties: + id: + type: string + nullable: true + description: | + Specifies the id of the statement mapping. + example: stmpabcd1234 description_column: type: string description: | @@ -358,19 +368,12 @@ preview_from_statement_in: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -384,10 +387,17 @@ preview_from_statement_in: description: | Card number from statement can be passed to get transactions only from specific card example: xxx5-4543 + start_date: + $ref: './fields.yaml#/timestamptz_utc' + description: | + Start date of the statement period + end_date: + $ref: './fields.yaml#/timestamptz_utc' + description: | + End date of the statement period required: - id - statement_mapping - - ignored_line_item_ids summary_from_statement_in: type: object @@ -473,19 +483,12 @@ summary_from_statement_in: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -494,10 +497,18 @@ summary_from_statement_in: This specifies list of statement line items to be ignored in the statement. example: - stlisfdfadssd + card_mapping: + $ref: '#/card_mapping_in' + ignore_archived_cards: + type: boolean + nullable: true + description: | + Controls how transactions associated with archived cards are handled during statement processing: + If true, transactions associated with archived cards are ignored. + If false, the archived cards are unarchived, and their associated transactions are processed. required: - id - statement_mapping - - ignored_line_item_ids card_mapping_in: type: array @@ -729,19 +740,12 @@ reconciliation_summary_from_statement_in: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -769,10 +773,16 @@ reconciliation_summary_from_statement_in: type: string example: - recexxxxxx + ignore_archived_cards: + type: boolean + nullable: true + description: | + Controls how transactions associated with archived cards are handled during statement processing: + If true, transactions associated with archived cards are ignored. + If false, the archived cards are unarchived, and their associated transactions are processed. required: - id - statement_mapping - - ignored_line_item_ids - reconciliation_entry_ids reconcile_from_statement_in: @@ -785,6 +795,12 @@ reconcile_from_statement_in: statement_mapping: type: object properties: + id: + type: string + nullable: true + description: | + Specifies the id of the statement mapping. + example: stmpabcd1234 description_column: type: string description: | @@ -859,19 +875,12 @@ reconcile_from_statement_in: example: VISA nullable: true required: - - description_column - transaction_date_column - - transaction_id_column - amount_column - card_number_column - merchant_column - - foreign_amount_column - - foreign_currency_column - - post_date_column - bank_name - is_debit_positive - - name - - card_network ignored_line_item_ids: type: array items: @@ -884,12 +893,10 @@ reconcile_from_statement_in: $ref: './fields.yaml#/timestamptz_utc' description: | Start date of the statement period - nullable: true end_date: $ref: './fields.yaml#/timestamptz_utc' description: | End date of the statement period - nullable: true card_mapping: $ref: '#/card_mapping_in' reconciliation_method: @@ -907,15 +914,28 @@ reconcile_from_statement_in: type: string example: - recexxxxxx + ignore_archived_cards: + type: boolean + nullable: true + description: | + Controls how transactions associated with archived cards are handled during statement processing: + If true, transactions associated with archived cards are ignored. + If false, the archived cards are unarchived, and their associated transactions are processed. required: - id - statement_mapping - - ignored_line_item_ids - reconciliation_method - reconciliation_entry_ids rtf_missing_transaction_from_statement_out: type: object + required: + - error + - missing_rtf_transactions + - rtf_confidence + - rtf_count + - total_count + - status properties: error: type: string @@ -927,9 +947,24 @@ rtf_missing_transaction_from_statement_out: type: array items: type: object + required: + - amount + - bank_name + - card_number + - currency + - description + - foreign_amount + - foreign_currency + - merchant + - post_date + - statement_line_item_id + - transaction_date + - transaction_id + - transaction_type + - unique_id properties: amount: - type: number + type: string description: | Specifies the amount on the statement. example: 30 @@ -1029,11 +1064,18 @@ rtf_missing_transaction_from_statement_out: rtf_stats_out: type: object + required: + - last_uploaded_at + - rtf_confidence properties: last_uploaded_at: - $ref: './fields.yaml#/timestamptz_utc' + oneOf: + - $ref: './fields.yaml#/timestamptz_utc' + - type: string + maxLength: 0 description: | Timestamp of the last uploaded statement. + Either a date-time string or an empty string. rtf_confidence: type: string description: | @@ -1146,6 +1188,16 @@ preview_out: - no_of_transactions summary_out: + type: object + required: + - id + - status + - period_start + - period_end + - statement_transaction_count + - statement_total + - total_cards + - bridging_entry_change_type properties: id: allOf: @@ -1192,6 +1244,12 @@ summary_out: _reconciliation_summary_object: + type: object + required: + - expense_count + - is_recommended + - reconciliation_method + - statement_transaction_count properties: expense_count: description: Number of expense matches found @@ -1211,6 +1269,9 @@ _reconciliation_summary_object: reconciliation_summary_out: + type: object + required: + - reconciliation_summary properties: reconciliation_summary: type: array @@ -1235,7 +1296,7 @@ card_stats_out: Card network of the statement if the statement has atleast one card enrolled in RTF. example: VISA nullable: true - missing_corporate_card_details: + corporate_card_details: type: array items: type: object @@ -1268,9 +1329,13 @@ card_stats_out: required: - missing_transactions_count - is_rtf_statement - - + - rtf_card_network + - corporate_card_details matching_cards_out: + type: object + required: + - statement_card_number + - matching_cards properties: statement_card_number: type: string @@ -1280,8 +1345,15 @@ matching_cards_out: matching_cards: type: array items: - type: - object + type: object + required: + - id + - card_number + - is_visa_enrolled + - is_mastercard_enrolled + - nickname + - user + - is_archived properties: id: allOf: @@ -1308,7 +1380,11 @@ matching_cards_out: example: 'Business Card' user: $ref: ./user.yaml#/user_out_embed_nullable - + is_archived: + type: boolean + description: | + If the card is archived in Sage Exp Mgmt + nullable: false unassigned_cards_from_statement_in: type: object properties: @@ -1320,3 +1396,189 @@ unassigned_cards_from_statement_in: example: stmtwownwrng required: - statement_id + +statement_archived_cards_out: + required: + - number_of_cards + - number_of_archived_cards + - archived_cards + properties: + number_of_cards: + type: integer + description: | + Number of cards in the statement + example: 3 + number_of_archived_cards: + type: integer + description: | + Number of cards in the statement that are archived in Sage Exp Mgmt + example: 1 + archived_cards: + type: array + items: + type: object + required: + - id + - card_number + - nickname + - user + - is_archived + - archived_at + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: bawownwrng + card_number: + $ref: './fields.yaml#/card_number' + nickname: + type: string + maxLength: 25 + nullable: true + description: | + Unique nickname assigned to the card + example: 'Business Card' + user: + $ref: ./user.yaml#/user_out_embed_nullable + is_archived: + type: boolean + description: | + If the card is archived in Sage Exp Mgmt + nullable: false + archived_at: + $ref: './fields.yaml#/timestamptz_utc' + description: | + Timestamp when the card was archived in Sage Exp Mgmt + nullable: true + + +statement_archived_cards_in: + type: object + properties: + id: + allOf: + - $ref: './fields.yaml#/id_string' + example: stmtadfdsdf + statement_mapping: + type: object + properties: + description_column: + type: string + description: | + Specifies the mapping of description column on the statement + nullable: true + example: description + transaction_date_column: + type: string + description: | + Specifies the mapping of transaction date on the statement. + example: txn date + transaction_id_column: + type: string + description: | + Specifies the mapping of transaction id / unique id on the statement. + example: reference number + nullable: true + amount_column: + type: string + description: | + Specifies the mapping of amount on the statement. + example: amount + card_number_column: + type: string + description: | + Specifies the mapping of card number on the statement. + example: account number + merchant_column: + type: string + description: | + Specifies the mapping of merchant on the statement. + example: Amazon + foreign_amount_column: + type: string + description: | + Specifies the mapping of foreign amount on the statement. + example: foreign amount + nullable: true + foreign_currency_column: + type: string + description: | + Specifies the mapping of foreign currency on the statement. + example: foreign currency + nullable: true + post_date_column: + type: string + description: | + Specifies the header name of the post date column in the statement. + example: post date + nullable: true + bank_name: + type: string + description: | + Specifies the bank name of the statement + example: American Express + is_debit_positive: + type: boolean + description: | + Specifies the representation of the the amount in the statement, if true then the amount represented by | + positive sign are debits, and if false then the amount represented by negative sign are debits. + example: true + name: + type: string + description: | + Specifies the mapping name. + example: USD + nullable: true + card_network: + type: string + description: | + Specifies the credit card network used by the card + example: VISA + nullable: true + required: + - transaction_date_column + - amount_column + - card_number_column + - merchant_column + - bank_name + - is_debit_positive + ignored_line_item_ids: + type: array + items: + type: string + description: > + This specifies list of statement line items to be ignored in the statement. + example: + - stlisfdfadssd + start_date: + $ref: './fields.yaml#/timestamptz_utc' + description: | + Start date of the statement period + nullable: true + end_date: + $ref: './fields.yaml#/timestamptz_utc' + description: | + End date of the statement period + nullable: true + card_mapping: + $ref: '#/card_mapping_in' + required: + - id + - statement_mapping + + +statement_archived_cards_ignore_in: + allOf: + - $ref: '#/statement_archived_cards_in' + - type: object + properties: + archived_card_ids: + type: array + items: + type: string + description: | + List of archived card ids to be ignored in the statement. + example: + - bawownwrng + required: + - archived_card_ids \ No newline at end of file diff --git a/src/components/schemas/subscriptions.yaml b/src/components/schemas/subscriptions.yaml index e61b5627c..4db7ff318 100644 --- a/src/components/schemas/subscriptions.yaml +++ b/src/components/schemas/subscriptions.yaml @@ -1,6 +1,13 @@ spender_subscriptions_out: type: object additionalProperties: False + required: + - id + - is_enabled + - webhook_url + - updated_at + - created_at + - user_id properties: id: $ref: ./fields.yaml#/id_string @@ -18,6 +25,13 @@ spender_subscriptions_out: approver_subscriptions_out: type: object additionalProperties: False + required: + - id + - is_enabled + - webhook_url + - updated_at + - created_at + - approver_user_id properties: id: $ref: ./fields.yaml#/id_string @@ -35,6 +49,14 @@ approver_subscriptions_out: admin_subscriptions_out: type: object additionalProperties: False + required: + - id + - is_enabled + - webhook_url + - updated_at + - created_at + - org_id + - subscribed_resources properties: id: $ref: ./fields.yaml#/id_string diff --git a/src/components/schemas/tax_group.yaml b/src/components/schemas/tax_group.yaml index 462bc9463..7d13a4335 100644 --- a/src/components/schemas/tax_group.yaml +++ b/src/components/schemas/tax_group.yaml @@ -1,6 +1,16 @@ tax_group_out: type: object additionalProperties: False + required: + - created_at + - updated_at + - id + - org_id + - code + - name + - percentage + - is_enabled + - is_default properties: id: allOf: @@ -25,6 +35,11 @@ tax_group_out: description: percentage of tax levied. is_enabled: $ref: './fields.yaml#/is_enabled' + is_default: + type: boolean + nullable: true + description: Indicates whether this tax group is the default for its percentage bucket. + example: false code: $ref: './fields.yaml#/code' @@ -54,5 +69,10 @@ tax_group_in: description: percentage of tax levied. is_enabled: $ref: './fields.yaml#/is_enabled' + is_default: + type: boolean + nullable: true + description: Indicates whether this tax group should be set as default for its percentage bucket. + example: false code: - $ref: './fields.yaml#/code' \ No newline at end of file + $ref: './fields.yaml#/code' diff --git a/src/components/schemas/user.yaml b/src/components/schemas/user.yaml index 8fd2e6646..1062e0d01 100644 --- a/src/components/schemas/user.yaml +++ b/src/components/schemas/user.yaml @@ -1,6 +1,13 @@ user_out: type: object additionalProperties: False + required: + - id + - created_at + - updated_at + - email + - full_name + - email_verified_at properties: id: $ref: './fields.yaml#/id_string' @@ -22,6 +29,10 @@ user_out: user_out_embed: type: object additionalProperties: False + required: + - id + - email + - full_name properties: id: allOf: @@ -42,6 +53,10 @@ user_out_embed_nullable: type: object nullable: true additionalProperties: False + required: + - id + - email + - full_name properties: id: allOf: @@ -61,6 +76,10 @@ user_out_nullable_example_null: type: object nullable: true additionalProperties: False + required: + - id + - email + - full_name properties: id: allOf: diff --git a/src/hod/openapi.yaml b/src/hod/openapi.yaml index d28fb4adf..f7a137076 100644 --- a/src/hod/openapi.yaml +++ b/src/hod/openapi.yaml @@ -19,7 +19,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' diff --git a/src/hod/paths/hod@budget_usages.yaml b/src/hod/paths/hod@budget_usages.yaml index 3db850da9..e56fb149b 100644 --- a/src/hod/paths/hod@budget_usages.yaml +++ b/src/hod/paths/hod@budget_usages.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/hop/openapi.yaml b/src/hop/openapi.yaml index ba504a9ab..2fe582df1 100644 --- a/src/hop/openapi.yaml +++ b/src/hop/openapi.yaml @@ -19,7 +19,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' diff --git a/src/hop/paths/hop@budget_usages.yaml b/src/hop/paths/hop@budget_usages.yaml index 3db850da9..e56fb149b 100644 --- a/src/hop/paths/hop@budget_usages.yaml +++ b/src/hop/paths/hop@budget_usages.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/manager/openapi.yaml b/src/manager/openapi.yaml index e13ed8e37..cb87e3710 100644 --- a/src/manager/openapi.yaml +++ b/src/manager/openapi.yaml @@ -18,7 +18,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' diff --git a/src/manager/paths/manager@employee_overview.yaml b/src/manager/paths/manager@employee_overview.yaml index a5b641007..9fba0df7a 100644 --- a/src/manager/paths/manager@employee_overview.yaml +++ b/src/manager/paths/manager@employee_overview.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: data: type: array diff --git a/src/manager/paths/manager@employee_overview@employees.yaml b/src/manager/paths/manager@employee_overview@employees.yaml index 17523f2bb..3a28b53ba 100644 --- a/src/manager/paths/manager@employee_overview@employees.yaml +++ b/src/manager/paths/manager@employee_overview@employees.yaml @@ -19,6 +19,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/manager/paths/manager@employee_overview@expense_comments.yaml b/src/manager/paths/manager@employee_overview@expense_comments.yaml index 0f1f90c42..062d67cb7 100644 --- a/src/manager/paths/manager@employee_overview@expense_comments.yaml +++ b/src/manager/paths/manager@employee_overview@expense_comments.yaml @@ -14,6 +14,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/manager/paths/manager@employee_overview@expense_policy_states.yaml b/src/manager/paths/manager@employee_overview@expense_policy_states.yaml index e668e5e0b..15efb9e69 100644 --- a/src/manager/paths/manager@employee_overview@expense_policy_states.yaml +++ b/src/manager/paths/manager@employee_overview@expense_policy_states.yaml @@ -26,6 +26,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/manager/paths/manager@employee_overview@expenses.yaml b/src/manager/paths/manager@employee_overview@expenses.yaml index d8cdc76a1..949505563 100644 --- a/src/manager/paths/manager@employee_overview@expenses.yaml +++ b/src/manager/paths/manager@employee_overview@expenses.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/manager/paths/manager@employee_overview@expenses@stats.yaml b/src/manager/paths/manager@employee_overview@expenses@stats.yaml index 99481ae3e..b4e9be6b4 100644 --- a/src/manager/paths/manager@employee_overview@expenses@stats.yaml +++ b/src/manager/paths/manager@employee_overview@expenses@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/employee.yaml#/employee_overview_expense_stats_out diff --git a/src/manager/paths/manager@employee_overview@files@generate_urls@bulk.yaml b/src/manager/paths/manager@employee_overview@files@generate_urls@bulk.yaml index aacf96bcc..91523915e 100644 --- a/src/manager/paths/manager@employee_overview@files@generate_urls@bulk.yaml +++ b/src/manager/paths/manager@employee_overview@files@generate_urls@bulk.yaml @@ -33,6 +33,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/manager/paths/manager@employee_overview@hierarchy.yaml b/src/manager/paths/manager@employee_overview@hierarchy.yaml index 4eb8c603a..894752b9b 100644 --- a/src/manager/paths/manager@employee_overview@hierarchy.yaml +++ b/src/manager/paths/manager@employee_overview@hierarchy.yaml @@ -12,6 +12,8 @@ get: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/manager/paths/manager@employee_overview@stats.yaml b/src/manager/paths/manager@employee_overview@stats.yaml index 7eb46a92a..0b90e52b4 100644 --- a/src/manager/paths/manager@employee_overview@stats.yaml +++ b/src/manager/paths/manager@employee_overview@stats.yaml @@ -32,6 +32,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: ../../components/schemas/employee.yaml#/employee_overview_stats_out diff --git a/src/owner/openapi.yaml b/src/owner/openapi.yaml index d8675d02a..57c549362 100644 --- a/src/owner/openapi.yaml +++ b/src/owner/openapi.yaml @@ -19,7 +19,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' diff --git a/src/spender/components/schemas/rating_prompt_state.yaml b/src/spender/components/schemas/rating_prompt_state.yaml new file mode 100644 index 000000000..22eb864f4 --- /dev/null +++ b/src/spender/components/schemas/rating_prompt_state.yaml @@ -0,0 +1,41 @@ +rating_prompt_state_out: + type: object + additionalProperties: false + properties: + last_rating_pre_prompt_dismiss_at: + type: string + format: date-time + nullable: true + description: | + When the user last dismissed the pre-prompt (native rating prompt not shown). Used for cooldown. + last_native_review_prompt_at: + type: string + format: date-time + nullable: true + description: | + When the client last invoked the OS in-app review API after the user accepted the pre-prompt. + Used for cooldown. + updated_at: + type: string + format: date-time + nullable: true + description: | + Server time of the last persisted update. Null when no row exists yet for the user. + created_at: + type: string + format: date-time + nullable: true + description: | + Server time when the row was first created for the user. Null when no row exists yet. + +rating_prompt_state_in: + type: object + additionalProperties: false + required: + - is_pre_prompt_dismissed + properties: + is_pre_prompt_dismissed: + type: boolean + description: | + `true` if the user dismissed the pre-prompt (native rating prompt was not shown); `false` if the native + rating prompt was shown. The server records the corresponding timestamp at request time using server UTC time. diff --git a/src/spender/openapi.yaml b/src/spender/openapi.yaml index cd7f18374..cfd945682 100644 --- a/src/spender/openapi.yaml +++ b/src/spender/openapi.yaml @@ -20,7 +20,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions' @@ -181,7 +181,7 @@ paths: $ref: 'paths/spender@reports@suggest_purpose.yaml' /spender/reports/filters: $ref: 'paths/spender@reports@filters.yaml' - /spender/reports/filters/delte: + /spender/reports/filters/delete: $ref: 'paths/spender@reports@filters@delete.yaml' /spender/reports/comments: $ref: 'paths/spender@reports@comments.yaml' @@ -203,6 +203,8 @@ paths: $ref: paths/spender@corporate_cards.yaml /spender/corporate_cards/yodlee_accounts: $ref: paths/spender@corporate_cards@yodlee_accounts.yaml + /spender/corporate_cards/rtf_monthly_enrollment_usage: + $ref: paths/spender@corporate_cards@rtf_monthly_enrollment_usage.yaml /spender/corporate_card_transactions: $ref: paths/spender@corporate_card_transactions.yaml /spender/corporate_card_transactions/expenses/stats: @@ -385,3 +387,7 @@ paths: $ref: paths/spender@reports@export_configurations.yaml /spender/reports/export_configurations/delete/bulk: $ref: paths/spender@reports@export_configurations@delete@bulk.yaml + /spender/mobile_app/versions: + $ref: paths/spender@mobile_app@versions.yaml + /spender/mobile_app/rating_prompt_state: + $ref: paths/spender@mobile_app@rating_prompt_state.yaml \ No newline at end of file diff --git a/src/spender/paths/spender@accounts.yaml b/src/spender/paths/spender@accounts.yaml index 0aa914e79..90c76ab92 100644 --- a/src/spender/paths/spender@accounts.yaml +++ b/src/spender/paths/spender@accounts.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@advance_request_files.yaml b/src/spender/paths/spender@advance_request_files.yaml index fbce63cf7..167d26a8b 100644 --- a/src/spender/paths/spender@advance_request_files.yaml +++ b/src/spender/paths/spender@advance_request_files.yaml @@ -40,6 +40,8 @@ post: application/json: schema: type: object + required: + - data properties: url: type: string diff --git a/src/spender/paths/spender@advance_requests.yaml b/src/spender/paths/spender@advance_requests.yaml index 5c8dff31a..1e735f2ca 100644 --- a/src/spender/paths/spender@advance_requests.yaml +++ b/src/spender/paths/spender@advance_requests.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -57,7 +61,7 @@ post: - data properties: data: - $ref: '../../components/schemas/advance_request.yaml#/advance_request_in' + $ref: '../../components/schemas/advance_request.yaml#/spender_advance_request_in' responses: '200': description: OK @@ -66,6 +70,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/spender/paths/spender@advance_requests@bulk_attach_file.yaml b/src/spender/paths/spender@advance_requests@bulk_attach_file.yaml index 14065e4b1..8da910c34 100644 --- a/src/spender/paths/spender@advance_requests@bulk_attach_file.yaml +++ b/src/spender/paths/spender@advance_requests@bulk_attach_file.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@advance_requests@comments.yaml b/src/spender/paths/spender@advance_requests@comments.yaml index 8f9b06917..f095c09d4 100644 --- a/src/spender/paths/spender@advance_requests@comments.yaml +++ b/src/spender/paths/spender@advance_requests@comments.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_comments_in' @@ -21,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_comments_out' diff --git a/src/spender/paths/spender@advance_requests@custom_fields.yaml b/src/spender/paths/spender@advance_requests@custom_fields.yaml index 867e4d8cf..4077807a1 100644 --- a/src/spender/paths/spender@advance_requests@custom_fields.yaml +++ b/src/spender/paths/spender@advance_requests@custom_fields.yaml @@ -12,6 +12,8 @@ get: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_custom_fields_out' diff --git a/src/spender/paths/spender@advance_requests@permissions.yaml b/src/spender/paths/spender@advance_requests@permissions.yaml index 744da3b9f..8f5d4031b 100644 --- a/src/spender/paths/spender@advance_requests@permissions.yaml +++ b/src/spender/paths/spender@advance_requests@permissions.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_permissions_out' diff --git a/src/spender/paths/spender@advance_requests@pull_back.yaml b/src/spender/paths/spender@advance_requests@pull_back.yaml index 3c718f32a..db7ceba87 100644 --- a/src/spender/paths/spender@advance_requests@pull_back.yaml +++ b/src/spender/paths/spender@advance_requests@pull_back.yaml @@ -28,6 +28,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' diff --git a/src/spender/paths/spender@advance_requests@stats.yaml b/src/spender/paths/spender@advance_requests@stats.yaml index 79f6aa154..456f09cd8 100644 --- a/src/spender/paths/spender@advance_requests@stats.yaml +++ b/src/spender/paths/spender@advance_requests@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_requests_stats_out' diff --git a/src/spender/paths/spender@advance_requests@submit.yaml b/src/spender/paths/spender@advance_requests@submit.yaml index 8abfe8cf7..287fae1b2 100644 --- a/src/spender/paths/spender@advance_requests@submit.yaml +++ b/src/spender/paths/spender@advance_requests@submit.yaml @@ -16,7 +16,7 @@ post: - data properties: data: - $ref: '../../components/schemas/advance_request.yaml#/advance_request_in' + $ref: '../../components/schemas/advance_request.yaml#/advance_request_submit_in' responses: '200': description: OK @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance_request.yaml#/advance_request_out' @@ -61,4 +63,4 @@ post: message: type: string description: | - This error means the requested resource was not found or the requester doesn't have sufficient access. \ No newline at end of file + This error means the requested resource was not found or the requester doesn't have sufficient access. diff --git a/src/spender/paths/spender@advance_requests_stats.yaml b/src/spender/paths/spender@advance_requests_stats.yaml index bea06bca9..c72d7f559 100644 --- a/src/spender/paths/spender@advance_requests_stats.yaml +++ b/src/spender/paths/spender@advance_requests_stats.yaml @@ -27,6 +27,8 @@ get: application/json: schema: type: object + required: + - data properties: url: type: string diff --git a/src/spender/paths/spender@advance_wallets.yaml b/src/spender/paths/spender@advance_wallets.yaml index 60186f0f9..3aefce568 100644 --- a/src/spender/paths/spender@advance_wallets.yaml +++ b/src/spender/paths/spender@advance_wallets.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@advances.yaml b/src/spender/paths/spender@advances.yaml index 578fe3745..5ed59c28f 100644 --- a/src/spender/paths/spender@advances.yaml +++ b/src/spender/paths/spender@advances.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@advances@stats.yaml b/src/spender/paths/spender@advances@stats.yaml index 54003447c..2e99a08d2 100644 --- a/src/spender/paths/spender@advances@stats.yaml +++ b/src/spender/paths/spender@advances@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/advance.yaml#/advances_stats_out' diff --git a/src/spender/paths/spender@automations@recurring_expenses.yaml b/src/spender/paths/spender@automations@recurring_expenses.yaml index 4f35c2281..d3872e9e3 100644 --- a/src/spender/paths/spender@automations@recurring_expenses.yaml +++ b/src/spender/paths/spender@automations@recurring_expenses.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/recurring_expense.yaml#/recurring_expense_out' @@ -70,6 +72,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@automations@recurring_expenses@disable.yaml b/src/spender/paths/spender@automations@recurring_expenses@disable.yaml index d42056ac1..3b61eea04 100644 --- a/src/spender/paths/spender@automations@recurring_expenses@disable.yaml +++ b/src/spender/paths/spender@automations@recurring_expenses@disable.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/recurring_expense.yaml#/recurring_expense_out' diff --git a/src/spender/paths/spender@budgets.yaml b/src/spender/paths/spender@budgets.yaml index a53a3d723..2c0eefe46 100644 --- a/src/spender/paths/spender@budgets.yaml +++ b/src/spender/paths/spender@budgets.yaml @@ -16,6 +16,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -24,7 +28,7 @@ get: data: type: array items: - $ref: '../../components/schemas/budget.yaml#/budget_out' + $ref: '../../components/schemas/budget.yaml#/spender_budget_out' '400': description: Bad request content: diff --git a/src/spender/paths/spender@categories.yaml b/src/spender/paths/spender@categories.yaml index 7bd49c87b..1a09f6921 100644 --- a/src/spender/paths/spender@categories.yaml +++ b/src/spender/paths/spender@categories.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@corporate_card_transactions.yaml b/src/spender/paths/spender@corporate_card_transactions.yaml index d4846db35..3a3b8c4e2 100644 --- a/src/spender/paths/spender@corporate_card_transactions.yaml +++ b/src/spender/paths/spender@corporate_card_transactions.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@corporate_card_transactions@expenses@stats.yaml b/src/spender/paths/spender@corporate_card_transactions@expenses@stats.yaml index 7d6e7c526..5e3202893 100644 --- a/src/spender/paths/spender@corporate_card_transactions@expenses@stats.yaml +++ b/src/spender/paths/spender@corporate_card_transactions@expenses@stats.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/spender/paths/spender@corporate_card_transactions@ignore.yaml b/src/spender/paths/spender@corporate_card_transactions@ignore.yaml index af8d658dd..2a34f0ea2 100644 --- a/src/spender/paths/spender@corporate_card_transactions@ignore.yaml +++ b/src/spender/paths/spender@corporate_card_transactions@ignore.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_ignore_out' diff --git a/src/spender/paths/spender@corporate_card_transactions@mark_personal.yaml b/src/spender/paths/spender@corporate_card_transactions@mark_personal.yaml index 446cbb7a1..17e2e040a 100644 --- a/src/spender/paths/spender@corporate_card_transactions@mark_personal.yaml +++ b/src/spender/paths/spender@corporate_card_transactions@mark_personal.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_mark_personal_out' diff --git a/src/spender/paths/spender@corporate_card_transactions@match.yaml b/src/spender/paths/spender@corporate_card_transactions@match.yaml index 20d943d2b..7fd39f0fd 100644 --- a/src/spender/paths/spender@corporate_card_transactions@match.yaml +++ b/src/spender/paths/spender@corporate_card_transactions@match.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_match_out' diff --git a/src/spender/paths/spender@corporate_card_transactions@undo_ignore.yaml b/src/spender/paths/spender@corporate_card_transactions@undo_ignore.yaml index b31f1e80a..5da053028 100644 --- a/src/spender/paths/spender@corporate_card_transactions@undo_ignore.yaml +++ b/src/spender/paths/spender@corporate_card_transactions@undo_ignore.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_undo_ignore_out' diff --git a/src/spender/paths/spender@corporate_card_transactions@unmark_personal.yaml b/src/spender/paths/spender@corporate_card_transactions@unmark_personal.yaml index 9a9971a12..49b7338fd 100644 --- a/src/spender/paths/spender@corporate_card_transactions@unmark_personal.yaml +++ b/src/spender/paths/spender@corporate_card_transactions@unmark_personal.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_unmark_personal_out' diff --git a/src/spender/paths/spender@corporate_card_transactions@unmatch.yaml b/src/spender/paths/spender@corporate_card_transactions@unmatch.yaml index d6225e595..59edc33a2 100644 --- a/src/spender/paths/spender@corporate_card_transactions@unmatch.yaml +++ b/src/spender/paths/spender@corporate_card_transactions@unmatch.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/corporate_card_transaction.yaml#/corporate_card_transaction_unmatch_out' diff --git a/src/spender/paths/spender@corporate_cards.yaml b/src/spender/paths/spender@corporate_cards.yaml index 21ad9fdb7..df2568472 100644 --- a/src/spender/paths/spender@corporate_cards.yaml +++ b/src/spender/paths/spender@corporate_cards.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@corporate_cards@rtf_monthly_enrollment_usage.yaml b/src/spender/paths/spender@corporate_cards@rtf_monthly_enrollment_usage.yaml new file mode 100644 index 000000000..8966ad16e --- /dev/null +++ b/src/spender/paths/spender@corporate_cards@rtf_monthly_enrollment_usage.yaml @@ -0,0 +1,39 @@ +get: + tags: + - Corporate Cards + summary: Get RTF monthly enrollment usage + description: | + This API returns the spender's current-month RTF corporate card enrollment usage, + including the number of cards enrolled, the configured monthly limit, and whether the limit has been reached. + operationId: corporate_cards_rtf_monthly_enrollment_usage + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../../components/schemas/corporate_card.yaml#/corporate_card_rtf_monthly_enrollment_usage_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/spender/paths/spender@corporate_cards@yodlee_accounts.yaml b/src/spender/paths/spender@corporate_cards@yodlee_accounts.yaml index afdb02ac0..68d62b6e6 100644 --- a/src/spender/paths/spender@corporate_cards@yodlee_accounts.yaml +++ b/src/spender/paths/spender@corporate_cards@yodlee_accounts.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@cost_centers.yaml b/src/spender/paths/spender@cost_centers.yaml index 928de7eda..ef5323175 100644 --- a/src/spender/paths/spender@cost_centers.yaml +++ b/src/spender/paths/spender@cost_centers.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@departments.yaml b/src/spender/paths/spender@departments.yaml index 4f488e6c4..5e7c847f6 100644 --- a/src/spender/paths/spender@departments.yaml +++ b/src/spender/paths/spender@departments.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@dependent_expense_field_values.yaml b/src/spender/paths/spender@dependent_expense_field_values.yaml index 595f62692..ecdc2f576 100644 --- a/src/spender/paths/spender@dependent_expense_field_values.yaml +++ b/src/spender/paths/spender@dependent_expense_field_values.yaml @@ -51,6 +51,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@dwolla_customers.yaml b/src/spender/paths/spender@dwolla_customers.yaml index f21470848..df4e4b6cb 100644 --- a/src/spender/paths/spender@dwolla_customers.yaml +++ b/src/spender/paths/spender@dwolla_customers.yaml @@ -13,6 +13,8 @@ get: schema: type: object additionalProperties: False + required: + - data properties: data: allOf: diff --git a/src/spender/paths/spender@email_files.yaml b/src/spender/paths/spender@email_files.yaml index ee331cce0..33cf8a983 100644 --- a/src/spender/paths/spender@email_files.yaml +++ b/src/spender/paths/spender@email_files.yaml @@ -34,6 +34,8 @@ post: application/json: schema: type: object + required: + - data properties: url: type: string diff --git a/src/spender/paths/spender@employees.yaml b/src/spender/paths/spender@employees.yaml index 8b047cd80..811db855e 100644 --- a/src/spender/paths/spender@employees.yaml +++ b/src/spender/paths/spender@employees.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -62,6 +66,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/employee.yaml#/spender_employee_out' diff --git a/src/spender/paths/spender@employees@current.yaml b/src/spender/paths/spender@employees@current.yaml index 3a30973eb..04650aea9 100644 --- a/src/spender/paths/spender@employees@current.yaml +++ b/src/spender/paths/spender@employees@current.yaml @@ -13,9 +13,14 @@ get: schema: type: object additionalProperties: False + required: + - data properties: data: - $ref: ../../components/schemas/employee.yaml#/spender_employee_current_out + anyOf: + - $ref: ../../components/schemas/employee.yaml#/spender_employee_current_out + - type: object + additionalProperties: false '400': description: Bad request content: diff --git a/src/spender/paths/spender@employees@delegators.yaml b/src/spender/paths/spender@employees@delegators.yaml index 8e48c86fa..40d1c9b4a 100644 --- a/src/spender/paths/spender@employees@delegators.yaml +++ b/src/spender/paths/spender@employees@delegators.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@exchange_rate.yaml b/src/spender/paths/spender@exchange_rate.yaml index 896868dd9..785da5366 100644 --- a/src/spender/paths/spender@exchange_rate.yaml +++ b/src/spender/paths/spender@exchange_rate.yaml @@ -35,6 +35,8 @@ get: application/json: schema: type: object + required: + - data properties: url: type: string diff --git a/src/spender/paths/spender@expense_fields.yaml b/src/spender/paths/spender@expense_fields.yaml index e64e0c2bb..fdb1a626c 100644 --- a/src/spender/paths/spender@expense_fields.yaml +++ b/src/spender/paths/spender@expense_fields.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@expense_files.yaml b/src/spender/paths/spender@expense_files.yaml index dddcb5c0a..19a113422 100644 --- a/src/spender/paths/spender@expense_files.yaml +++ b/src/spender/paths/spender@expense_files.yaml @@ -39,6 +39,8 @@ post: application/json: schema: type: object + required: + - data properties: url: type: string diff --git a/src/spender/paths/spender@expense_policies.yaml b/src/spender/paths/spender@expense_policies.yaml index 0d9bd3dd9..62ae5e3b3 100644 --- a/src/spender/paths/spender@expense_policies.yaml +++ b/src/spender/paths/spender@expense_policies.yaml @@ -58,6 +58,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@expense_policies@states.yaml b/src/spender/paths/spender@expense_policies@states.yaml index 9316b6a4e..2bd6f130f 100644 --- a/src/spender/paths/spender@expense_policies@states.yaml +++ b/src/spender/paths/spender@expense_policies@states.yaml @@ -29,6 +29,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@expense_policy_comments.yaml b/src/spender/paths/spender@expense_policy_comments.yaml index 527955494..5c3668172 100644 --- a/src/spender/paths/spender@expense_policy_comments.yaml +++ b/src/spender/paths/spender@expense_policy_comments.yaml @@ -26,6 +26,9 @@ post: type: array items: type: object + required: + - comment_type + - comment_text properties: comment_type: type: string @@ -55,6 +58,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: object diff --git a/src/spender/paths/spender@expense_stats.yaml b/src/spender/paths/spender@expense_stats.yaml index 5ac7f36c4..24691f8b0 100644 --- a/src/spender/paths/spender@expense_stats.yaml +++ b/src/spender/paths/spender@expense_stats.yaml @@ -35,6 +35,8 @@ get: application/json: schema: type: object + required: + - data properties: url: type: string diff --git a/src/spender/paths/spender@expenses.yaml b/src/spender/paths/spender@expenses.yaml index 01c8aca19..e1eadd6ec 100644 --- a/src/spender/paths/spender@expenses.yaml +++ b/src/spender/paths/spender@expenses.yaml @@ -14,6 +14,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: description: | diff --git a/src/spender/paths/spender@expenses@attach_files@bulk.yaml b/src/spender/paths/spender@expenses@attach_files@bulk.yaml index 697d8e58d..10a43e46a 100644 --- a/src/spender/paths/spender@expenses@attach_files@bulk.yaml +++ b/src/spender/paths/spender@expenses@attach_files@bulk.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@expenses@attach_receipt.yaml b/src/spender/paths/spender@expenses@attach_receipt.yaml index 7f9b03b94..a2a2a0b57 100644 --- a/src/spender/paths/spender@expenses@attach_receipt.yaml +++ b/src/spender/paths/spender@expenses@attach_receipt.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_out' diff --git a/src/spender/paths/spender@expenses@bulk.yaml b/src/spender/paths/spender@expenses@bulk.yaml index dc552913d..45a44b83d 100644 --- a/src/spender/paths/spender@expenses@bulk.yaml +++ b/src/spender/paths/spender@expenses@bulk.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/spender_expenses_bulk_in' @@ -21,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@expenses@check_policies.yaml b/src/spender/paths/spender@expenses@check_policies.yaml index 7127e4f80..6de6fd159 100644 --- a/src/spender/paths/spender@expenses@check_policies.yaml +++ b/src/spender/paths/spender@expenses@check_policies.yaml @@ -29,6 +29,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/expense.yaml#/expense_check_policies_out diff --git a/src/spender/paths/spender@expenses@check_policies_bulk.yaml b/src/spender/paths/spender@expenses@check_policies_bulk.yaml index 46a8d4cad..c72a9c70f 100644 --- a/src/spender/paths/spender@expenses@check_policies_bulk.yaml +++ b/src/spender/paths/spender@expenses@check_policies_bulk.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/expense.yaml#/expense_check_policies_bulk_out diff --git a/src/spender/paths/spender@expenses@comments.yaml b/src/spender/paths/spender@expenses@comments.yaml index 3231c3d8a..ff96ac90f 100644 --- a/src/spender/paths/spender@expenses@comments.yaml +++ b/src/spender/paths/spender@expenses@comments.yaml @@ -13,6 +13,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@expenses@comments@bulk.yaml b/src/spender/paths/spender@expenses@comments@bulk.yaml index 9411f87fc..60bf39510 100644 --- a/src/spender/paths/spender@expenses@comments@bulk.yaml +++ b/src/spender/paths/spender@expenses@comments@bulk.yaml @@ -13,6 +13,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_comments_bulk_in' @@ -23,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@expenses@create_from_file@bulk.yaml b/src/spender/paths/spender@expenses@create_from_file@bulk.yaml index 6b74fb2a7..593289c15 100644 --- a/src/spender/paths/spender@expenses@create_from_file@bulk.yaml +++ b/src/spender/paths/spender@expenses@create_from_file@bulk.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@expenses@create_from_receipt.yaml b/src/spender/paths/spender@expenses@create_from_receipt.yaml index ffd0a8bdd..642668b1f 100644 --- a/src/spender/paths/spender@expenses@create_from_receipt.yaml +++ b/src/spender/paths/spender@expenses@create_from_receipt.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_out' diff --git a/src/spender/paths/spender@expenses@duplicate_sets.yaml b/src/spender/paths/spender@expenses@duplicate_sets.yaml index f8f622c84..417a4ac2d 100644 --- a/src/spender/paths/spender@expenses@duplicate_sets.yaml +++ b/src/spender/paths/spender@expenses@duplicate_sets.yaml @@ -21,6 +21,8 @@ get: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@expenses@export_configurations.yaml b/src/spender/paths/spender@expenses@export_configurations.yaml index 97125b24e..c5b29e88e 100644 --- a/src/spender/paths/spender@expenses@export_configurations.yaml +++ b/src/spender/paths/spender@expenses@export_configurations.yaml @@ -17,6 +17,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -154,6 +158,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expenses_export_configurations.yaml#/expenses_export_configuration_out' diff --git a/src/spender/paths/spender@expenses@exports.yaml b/src/spender/paths/spender@expenses@exports.yaml index 0736bd382..1e0d8906e 100644 --- a/src/spender/paths/spender@expenses@exports.yaml +++ b/src/spender/paths/spender@expenses@exports.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expenses_exports.yaml#/expenses_exports_out' diff --git a/src/spender/paths/spender@expenses@filters.yaml b/src/spender/paths/spender@expenses@filters.yaml index c8f5df08d..ff4e69e9a 100644 --- a/src/spender/paths/spender@expenses@filters.yaml +++ b/src/spender/paths/spender@expenses@filters.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense_filters.yaml#/expense_filters_out' @@ -59,6 +61,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@expenses@filters@delete.yaml b/src/spender/paths/spender@expenses@filters@delete.yaml index 144f8b063..0acdb816f 100644 --- a/src/spender/paths/spender@expenses@filters@delete.yaml +++ b/src/spender/paths/spender@expenses@filters@delete.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense_filters.yaml#/expense_filters_out' diff --git a/src/spender/paths/spender@expenses@merge.yaml b/src/spender/paths/spender@expenses@merge.yaml index 9684a9e75..1f7c77091 100644 --- a/src/spender/paths/spender@expenses@merge.yaml +++ b/src/spender/paths/spender@expenses@merge.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expenses_merge_in' @@ -21,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_out' diff --git a/src/spender/paths/spender@expenses@permissions.yaml b/src/spender/paths/spender@expenses@permissions.yaml index d6001df6f..3364da543 100644 --- a/src/spender/paths/spender@expenses@permissions.yaml +++ b/src/spender/paths/spender@expenses@permissions.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_permissions_out' diff --git a/src/spender/paths/spender@expenses@permissions@bulk.yaml b/src/spender/paths/spender@expenses@permissions@bulk.yaml index e6c19225c..8cfe9e758 100644 --- a/src/spender/paths/spender@expenses@permissions@bulk.yaml +++ b/src/spender/paths/spender@expenses@permissions@bulk.yaml @@ -33,6 +33,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expense_permissions_bulk_out' diff --git a/src/spender/paths/spender@expenses@policy_test.yaml b/src/spender/paths/spender@expenses@policy_test.yaml index a28d0d139..07c740338 100644 --- a/src/spender/paths/spender@expenses@policy_test.yaml +++ b/src/spender/paths/spender@expenses@policy_test.yaml @@ -14,6 +14,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/spender_expense_in' @@ -24,6 +26,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/policy.yaml#/policy_test_out' diff --git a/src/spender/paths/spender@expenses@split.yaml b/src/spender/paths/spender@expenses@split.yaml index 207118e4d..be727a4b8 100644 --- a/src/spender/paths/spender@expenses@split.yaml +++ b/src/spender/paths/spender@expenses@split.yaml @@ -11,6 +11,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/spender_split_expense_in' @@ -21,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@expenses@split@check_mandatory_fields.yaml b/src/spender/paths/spender@expenses@split@check_mandatory_fields.yaml index 2037b253e..3285f9d30 100644 --- a/src/spender/paths/spender@expenses@split@check_mandatory_fields.yaml +++ b/src/spender/paths/spender@expenses@split@check_mandatory_fields.yaml @@ -13,6 +13,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/spender_split_expense_in' @@ -23,6 +25,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@expenses@split@check_policies.yaml b/src/spender/paths/spender@expenses@split@check_policies.yaml index deeaf5fe1..583c809e9 100644 --- a/src/spender/paths/spender@expenses@split@check_policies.yaml +++ b/src/spender/paths/spender@expenses@split@check_policies.yaml @@ -14,6 +14,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/spender_split_expense_in' @@ -24,6 +26,8 @@ post: application/json: schema: type: object + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@expenses@stats.yaml b/src/spender/paths/spender@expenses@stats.yaml index ee129cee4..0bf898b7c 100644 --- a/src/spender/paths/spender@expenses@stats.yaml +++ b/src/spender/paths/spender@expenses@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/expense.yaml#/expenses_stats_out' diff --git a/src/spender/paths/spender@feature_configs.yaml b/src/spender/paths/spender@feature_configs.yaml index e06443977..395c1c432 100644 --- a/src/spender/paths/spender@feature_configs.yaml +++ b/src/spender/paths/spender@feature_configs.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@files.yaml b/src/spender/paths/spender@files.yaml index eed5916ba..053d51b3f 100644 --- a/src/spender/paths/spender@files.yaml +++ b/src/spender/paths/spender@files.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/file.yaml#/file_out diff --git a/src/spender/paths/spender@files@bulk.yaml b/src/spender/paths/spender@files@bulk.yaml index 0e90578db..ae24251cd 100644 --- a/src/spender/paths/spender@files@bulk.yaml +++ b/src/spender/paths/spender@files@bulk.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@files@generate_urls.yaml b/src/spender/paths/spender@files@generate_urls.yaml index 4a7180a10..8a3c6233b 100644 --- a/src/spender/paths/spender@files@generate_urls.yaml +++ b/src/spender/paths/spender@files@generate_urls.yaml @@ -27,6 +27,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/file.yaml#/file_generate_urls_action_out diff --git a/src/spender/paths/spender@files@generate_urls@bulk.yaml b/src/spender/paths/spender@files@generate_urls@bulk.yaml index e132a077e..13432b189 100644 --- a/src/spender/paths/spender@files@generate_urls@bulk.yaml +++ b/src/spender/paths/spender@files@generate_urls@bulk.yaml @@ -32,6 +32,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array diff --git a/src/spender/paths/spender@files@upload_html.yaml b/src/spender/paths/spender@files@upload_html.yaml index dfacbc82d..b2f0c49b9 100644 --- a/src/spender/paths/spender@files@upload_html.yaml +++ b/src/spender/paths/spender@files@upload_html.yaml @@ -37,6 +37,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/file.yaml#/file_out_download_url diff --git a/src/spender/paths/spender@merchants.yaml b/src/spender/paths/spender@merchants.yaml index 36055f86e..457f142c6 100644 --- a/src/spender/paths/spender@merchants.yaml +++ b/src/spender/paths/spender@merchants.yaml @@ -19,6 +19,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@mileage_rates.yaml b/src/spender/paths/spender@mileage_rates.yaml index 142a3d7e3..e970fe75e 100644 --- a/src/spender/paths/spender@mileage_rates.yaml +++ b/src/spender/paths/spender@mileage_rates.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@mobile_app@rating_prompt_state.yaml b/src/spender/paths/spender@mobile_app@rating_prompt_state.yaml new file mode 100644 index 000000000..7546c421c --- /dev/null +++ b/src/spender/paths/spender@mobile_app@rating_prompt_state.yaml @@ -0,0 +1,90 @@ +get: + tags: + - Mobile app + summary: Get mobile app rating prompt state for the current user + operationId: mobile_app_rating_prompt_state_get + description: | + Returns persisted timestamps for in-app rating pre-prompt cooldowns. + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../components/schemas/rating_prompt_state.yaml#/rating_prompt_state_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: ../../components/schemas/400.yaml + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + +post: + tags: + - Mobile app + summary: Update mobile app rating prompt state for the current user + operationId: mobile_app_rating_prompt_state_post + description: | + Records either a pre-prompt dismiss (`is_pre_prompt_dismissed: true`, native prompt not shown) or that the native + rating prompt was shown (`false`), using server UTC time. `created_at` is set only on first insert. + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../components/schemas/rating_prompt_state.yaml#/rating_prompt_state_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - data + properties: + data: + $ref: '../components/schemas/rating_prompt_state.yaml#/rating_prompt_state_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: ../../components/schemas/400.yaml + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/spender/paths/spender@mobile_app@versions.yaml b/src/spender/paths/spender@mobile_app@versions.yaml new file mode 100644 index 000000000..8bbd5f707 --- /dev/null +++ b/src/spender/paths/spender@mobile_app@versions.yaml @@ -0,0 +1,111 @@ +get: + tags: + - Mobile App Versions + summary: List mobile app versions + operationId: mobile_app_versions_list + description: | + This API supports filtering and pagination via query parameters. Returns mobile app version entries for the current user. + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + required: + - data + - count + - offset + properties: + count: + description: | + The total number of objects that can be requested. + type: integer + example: 10000 + offset: + description: > + offset is used to skip that many number of objects before + counting.
+ + For example, if there are 2000 objects,
+ + The first request will have offset as 0 and limit as 1000 to + return first 1000 objects.
+ + The second request will have offset as 1000 and limit as 1000 + to return next 1000 objects.
+ type: integer + example: 10 + data: + type: array + items: + $ref: '../../components/schemas/mobile_app_version.yaml#/mobile_app_version_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: ../../components/schemas/400.yaml + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' + +post: + tags: + - Mobile App Versions + summary: Create a mobile app version entry + operationId: mobile_app_versions_post + description: | + Creates a new mobile app version entry for the current user. Throws an error if an entry with the same (user_id, version, os.name, os.version) already exists. + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: '../../components/schemas/mobile_app_version.yaml#/mobile_app_version_in' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: False + required: + - data + properties: + data: + $ref: '../../components/schemas/mobile_app_version.yaml#/mobile_app_version_out' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '../../components/schemas/400.yaml' + '401': + description: Unauthorized request + content: + application/json: + schema: + $ref: '../../components/schemas/401.yaml' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '../../components/schemas/403.yaml' diff --git a/src/spender/paths/spender@my_profile.yaml b/src/spender/paths/spender@my_profile.yaml index eaf82e88d..cc2a50d41 100644 --- a/src/spender/paths/spender@my_profile.yaml +++ b/src/spender/paths/spender@my_profile.yaml @@ -10,6 +10,8 @@ get: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/my_profile.yaml#/my_profile_out' diff --git a/src/spender/paths/spender@orgs.yaml b/src/spender/paths/spender@orgs.yaml index 2068dc983..0da982cbb 100644 --- a/src/spender/paths/spender@orgs.yaml +++ b/src/spender/paths/spender@orgs.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@orgs_bank_details.yaml b/src/spender/paths/spender@orgs_bank_details.yaml index e73460a49..9a80f9c7e 100644 --- a/src/spender/paths/spender@orgs_bank_details.yaml +++ b/src/spender/paths/spender@orgs_bank_details.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@per_diem_rates.yaml b/src/spender/paths/spender@per_diem_rates.yaml index 5efb8de8e..0ff16825e 100644 --- a/src/spender/paths/spender@per_diem_rates.yaml +++ b/src/spender/paths/spender@per_diem_rates.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@personal_card_transactions.yaml b/src/spender/paths/spender@personal_card_transactions.yaml index 9fcd02ce6..af414897d 100644 --- a/src/spender/paths/spender@personal_card_transactions.yaml +++ b/src/spender/paths/spender@personal_card_transactions.yaml @@ -78,6 +78,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@personal_card_transactions@expense_suggestion.yaml b/src/spender/paths/spender@personal_card_transactions@expense_suggestion.yaml index 4f80a06aa..eece62b5b 100644 --- a/src/spender/paths/spender@personal_card_transactions@expense_suggestion.yaml +++ b/src/spender/paths/spender@personal_card_transactions@expense_suggestion.yaml @@ -29,11 +29,13 @@ get: application/json: schema: type: object + required: + - data properties: data: type: array items: - $ref: ../../components/schemas/expense.yaml#/expense_out + $ref: ../../components/schemas/expense.yaml#/expense_out_with_department_name '400': description: Bad request content: diff --git a/src/spender/paths/spender@personal_card_transactions@stats.yaml b/src/spender/paths/spender@personal_card_transactions@stats.yaml index 9b2c4a2a5..d15303184 100644 --- a/src/spender/paths/spender@personal_card_transactions@stats.yaml +++ b/src/spender/paths/spender@personal_card_transactions@stats.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data additionalProperties: False properties: data: diff --git a/src/spender/paths/spender@personal_cards.yaml b/src/spender/paths/spender@personal_cards.yaml index 278928a4b..6a16a44c8 100644 --- a/src/spender/paths/spender@personal_cards.yaml +++ b/src/spender/paths/spender@personal_cards.yaml @@ -19,6 +19,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: array @@ -52,6 +54,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@projects.yaml b/src/spender/paths/spender@projects.yaml index df6babed6..e3d8d743d 100644 --- a/src/spender/paths/spender@projects.yaml +++ b/src/spender/paths/spender@projects.yaml @@ -12,6 +12,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@recently_used_fields.yaml b/src/spender/paths/spender@recently_used_fields.yaml index b66ec3eed..f6e2590fa 100644 --- a/src/spender/paths/spender@recently_used_fields.yaml +++ b/src/spender/paths/spender@recently_used_fields.yaml @@ -10,6 +10,8 @@ get: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/recently_used_fields.yaml#/recently_used_fields_out' diff --git a/src/spender/paths/spender@report_stats.yaml b/src/spender/paths/spender@report_stats.yaml index 11d6b2b6c..2da1cb783 100644 --- a/src/spender/paths/spender@report_stats.yaml +++ b/src/spender/paths/spender@report_stats.yaml @@ -19,6 +19,8 @@ get: application/json: schema: type: object + required: + - data properties: url: type: string diff --git a/src/spender/paths/spender@reports.yaml b/src/spender/paths/spender@reports.yaml index 8f7f28331..7ebc05027 100644 --- a/src/spender/paths/spender@reports.yaml +++ b/src/spender/paths/spender@reports.yaml @@ -68,6 +68,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@reports@add_expenses.yaml b/src/spender/paths/spender@reports@add_expenses.yaml index d84f51bf9..762ca0bca 100644 --- a/src/spender/paths/spender@reports@add_expenses.yaml +++ b/src/spender/paths/spender@reports@add_expenses.yaml @@ -24,6 +24,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/spender/paths/spender@reports@comments.yaml b/src/spender/paths/spender@reports@comments.yaml index 883b28497..7e3628021 100644 --- a/src/spender/paths/spender@reports@comments.yaml +++ b/src/spender/paths/spender@reports@comments.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_comments_out' diff --git a/src/spender/paths/spender@reports@eject_expenses.yaml b/src/spender/paths/spender@reports@eject_expenses.yaml index ceeb17152..76358806b 100644 --- a/src/spender/paths/spender@reports@eject_expenses.yaml +++ b/src/spender/paths/spender@reports@eject_expenses.yaml @@ -26,6 +26,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/spender/paths/spender@reports@export_configurations.yaml b/src/spender/paths/spender@reports@export_configurations.yaml index de4806702..e19fcb464 100644 --- a/src/spender/paths/spender@reports@export_configurations.yaml +++ b/src/spender/paths/spender@reports@export_configurations.yaml @@ -17,6 +17,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -79,6 +83,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/reports_export_configurations.yaml#/reports_export_configuration_out' diff --git a/src/spender/paths/spender@reports@exports.yaml b/src/spender/paths/spender@reports@exports.yaml index 8ef4d0269..9d98a5198 100644 --- a/src/spender/paths/spender@reports@exports.yaml +++ b/src/spender/paths/spender@reports@exports.yaml @@ -11,6 +11,11 @@ get: content: application/json: schema: + type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' @@ -59,6 +64,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/reports_exports.yaml#/reports_exports_out' diff --git a/src/spender/paths/spender@reports@filters.yaml b/src/spender/paths/spender@reports@filters.yaml index 417e44f3e..4b06a8705 100644 --- a/src/spender/paths/spender@reports@filters.yaml +++ b/src/spender/paths/spender@reports@filters.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/report_filters.yaml#/report_filters_out' @@ -59,6 +61,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: data: type: array diff --git a/src/spender/paths/spender@reports@filters@delete.yaml b/src/spender/paths/spender@reports@filters@delete.yaml index 50d56712a..63bceca83 100644 --- a/src/spender/paths/spender@reports@filters@delete.yaml +++ b/src/spender/paths/spender@reports@filters@delete.yaml @@ -23,6 +23,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/report_filters.yaml#/report_filters_out' diff --git a/src/spender/paths/spender@reports@permissions.yaml b/src/spender/paths/spender@reports@permissions.yaml index 00c0674d9..71ca3ad25 100644 --- a/src/spender/paths/spender@reports@permissions.yaml +++ b/src/spender/paths/spender@reports@permissions.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report_permissions.yaml#/report_permissions_out' diff --git a/src/spender/paths/spender@reports@resubmit.yaml b/src/spender/paths/spender@reports@resubmit.yaml index d031ff6b6..55b68d276 100644 --- a/src/spender/paths/spender@reports@resubmit.yaml +++ b/src/spender/paths/spender@reports@resubmit.yaml @@ -24,6 +24,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/spender/paths/spender@reports@stats.yaml b/src/spender/paths/spender@reports@stats.yaml index bd00c4e13..029c82d13 100644 --- a/src/spender/paths/spender@reports@stats.yaml +++ b/src/spender/paths/spender@reports@stats.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/reports_stats_out' diff --git a/src/spender/paths/spender@reports@submit.yaml b/src/spender/paths/spender@reports@submit.yaml index c655c82df..3b521a248 100644 --- a/src/spender/paths/spender@reports@submit.yaml +++ b/src/spender/paths/spender@reports@submit.yaml @@ -24,6 +24,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_out' diff --git a/src/spender/paths/spender@reports@suggest_purpose.yaml b/src/spender/paths/spender@reports@suggest_purpose.yaml index 62e20eac5..3079e4f37 100644 --- a/src/spender/paths/spender@reports@suggest_purpose.yaml +++ b/src/spender/paths/spender@reports@suggest_purpose.yaml @@ -24,6 +24,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: '../../components/schemas/report.yaml#/report_purpose_out' diff --git a/src/spender/paths/spender@schedules.yaml b/src/spender/paths/spender@schedules.yaml index 9a28c8975..13cf2a8f6 100644 --- a/src/spender/paths/spender@schedules.yaml +++ b/src/spender/paths/spender@schedules.yaml @@ -25,6 +25,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/schedule.yaml#/schedule_out @@ -68,6 +70,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@secondary_emails.yaml b/src/spender/paths/spender@secondary_emails.yaml index 769a49933..d5f554748 100644 --- a/src/spender/paths/spender@secondary_emails.yaml +++ b/src/spender/paths/spender@secondary_emails.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml @@ -62,6 +66,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: $ref: ../../components/schemas/secondary_email.yaml#/secondary_email_out diff --git a/src/spender/paths/spender@secondary_emails@check.yaml b/src/spender/paths/spender@secondary_emails@check.yaml index 20eb49ab5..4f316949c 100644 --- a/src/spender/paths/spender@secondary_emails@check.yaml +++ b/src/spender/paths/spender@secondary_emails@check.yaml @@ -35,6 +35,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: object diff --git a/src/spender/paths/spender@secondary_emails@delete.yaml b/src/spender/paths/spender@secondary_emails@delete.yaml index 2def9c992..273910199 100644 --- a/src/spender/paths/spender@secondary_emails@delete.yaml +++ b/src/spender/paths/spender@secondary_emails@delete.yaml @@ -35,6 +35,8 @@ post: schema: type: object additionalProperties: False + required: + - data properties: data: type: object diff --git a/src/spender/paths/spender@subscriptions.yaml b/src/spender/paths/spender@subscriptions.yaml index ab79aa604..d9ab5b93a 100644 --- a/src/spender/paths/spender@subscriptions.yaml +++ b/src/spender/paths/spender@subscriptions.yaml @@ -11,6 +11,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/subscriptions.yaml#/subscriptions_in' @@ -22,6 +24,8 @@ post: schema: type: object additionalProperties: false + required: + - data properties: data: $ref: '../../components/schemas/subscriptions.yaml#/spender_subscriptions_out' @@ -72,6 +76,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: ../../components/schemas/count.yaml diff --git a/src/spender/paths/spender@tax_groups.yaml b/src/spender/paths/spender@tax_groups.yaml index 1a71789ce..948f9d971 100644 --- a/src/spender/paths/spender@tax_groups.yaml +++ b/src/spender/paths/spender@tax_groups.yaml @@ -13,6 +13,10 @@ get: schema: type: object additionalProperties: False + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@virtual_cards.yaml b/src/spender/paths/spender@virtual_cards.yaml index e335c47e0..0975de9b8 100644 --- a/src/spender/paths/spender@virtual_cards.yaml +++ b/src/spender/paths/spender@virtual_cards.yaml @@ -18,6 +18,10 @@ get: application/json: schema: type: object + required: + - data + - count + - offset properties: count: $ref: '../../components/schemas/count.yaml' diff --git a/src/spender/paths/spender@virtual_cards@get_current_amount.yaml b/src/spender/paths/spender@virtual_cards@get_current_amount.yaml index 7de87d1e4..c241f2727 100644 --- a/src/spender/paths/spender@virtual_cards@get_current_amount.yaml +++ b/src/spender/paths/spender@virtual_cards@get_current_amount.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/virtual_card.yaml#/virtual_cards_get_current_balance_out' diff --git a/src/spender/paths/spender@virtual_cards@show_card_details.yaml b/src/spender/paths/spender@virtual_cards@show_card_details.yaml index 49e8b924f..017381b29 100644 --- a/src/spender/paths/spender@virtual_cards@show_card_details.yaml +++ b/src/spender/paths/spender@virtual_cards@show_card_details.yaml @@ -24,6 +24,8 @@ post: application/json: schema: type: object + required: + - data properties: data: $ref: '../../components/schemas/virtual_card.yaml#/virtual_cards_show_card_details_out' diff --git a/src/super_admin/openapi.yaml b/src/super_admin/openapi.yaml index 4a83d9100..9d7176336 100644 --- a/src/super_admin/openapi.yaml +++ b/src/super_admin/openapi.yaml @@ -18,7 +18,7 @@ components: type: oauth2 flows: authorizationCode: - authorizationUrl: 'https://app.fylehq.com/app/developers/#/oauth/authorize' + authorizationUrl: 'https://app.fylehq.com/app/developers/oauth/authorize' tokenUrl: 'https://accounts.fylehq.com/oauth/token' scopes: '*': 'Grant all actions'