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(defaultomni),skip,limit. -
GET /sheets/{id}— Get a sheet settings record by id. -
GET /sheets/{service}/{name}— Retrieve settings byserviceandname(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— Resetcolumn_mappingto 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 asspreadsheet_title,sheets[]and permission checks.
Implementation & notes
- Endpoint implementation: backend/service_omni/app/api/v1/endpoints/sheets.py
-
Operational notes: Confirm column mapping matches the spreadsheet layout before running cron jobs or bulk updates. Use
test-connectionto validate credentials and spreadsheet access.