Skip to content

Sheets

service_omni — Endpoints: Sheets

Location: backend/service_omni/app/api/v1/endpoints/sheets.py

Summary

  • Configuration and access helpers for Google Sheets settings used by service_omni (shopping table, mappings, test-connection).

Routes

  • GET /sheets/ — List sheet settings. Query params: service (default omni), skip, limit.

  • GET /sheets/{id} — Get a sheet settings record by id.

  • GET /sheets/{service}/{name} — Retrieve settings by service and name (e.g., omni/shoppingtable).

  • POST /sheets/ — Create or update a sheet settings record. Body model: SheetSettingsCreate (example fields: name, spreadsheet_id, sheet_id, service, column_mapping).

Example body:

{
  "name": "shoppingtable",
  "spreadsheet_id": "1abcDEF...",
  "sheet_id": "0",
  "service": "omni",
  "column_mapping": { "invoice": "K", "date": "A", "sku": "B", "status": "L" }
}
  • PATCH /sheets/{service}/{name}/reset-mapping — Reset column_mapping to an empty object.
  • DELETE /sheets/{id} — Delete settings by id.

Connection testing

  • GET /sheets/test-connection (implemented inside the manager/endpoints) — Validates Google credential and returns spreadsheet metadata such as spreadsheet_title, sheets[] and permission checks.

Implementation & notes