Sheets
service_jtl — Endpoints: Sheets¶
Google Sheets integration endpoints used by inbound processing and confirmations.
Settings¶
POST /settings— Update the single Google Sheets settings record. Body model:SheetSettingsUpdate(spreadsheet_id, sheet_id, column mappings, etc.).GET /settings— Retrieve configured sheet settings.DELETE /settings— Reset sheet settings to defaults.
Connection & metadata¶
GET /test-connection— Test the configured credential and spreadsheet access. ReturnsConnectionTestResponsecontainingspreadsheet_title,spreadsheet_id, and sheet metadata.
Example success response excerpt:
{
"success": true,
"message": "Google Sheets connection successful",
"spreadsheet_title": "Inbound Checker",
"spreadsheet_id": "1abcDEF...",
"sheets": [{ "title": "Sheet1", "sheetId": 0, "index": 0 }]
}
Read / write helpers¶
GET /inbounds?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD— Returns rows (checkers/inbounds) from the sheet between the provided dates. UsesSheets_Manager.get_checkers_for_month/get_inbounds_for_date.POST /confirmations/bulk-update— Bulk update confirmation statuses. Body:BulkConfirmationUpdatewithupdates: [ { row: <int>, status: "SUCCESS"|"FAIL" } ].
Implementation¶
- Endpoint implementation: backend/service_jtl/app/api/v1/endpoints/sheets.py
- Sheets manager implementation: backend/service_jtl/app/services/sheets.py
Operational notes¶
Sheets_Manageruses stored Google credentials (viacredential_id) and currentSheetSettings(DB id 2 is used in the service). Usetest-connectionto validate spreadsheet access before running cron jobs.- Column mapping settings control which columns the service reads/writes for invoice date, invoice number, confirmation column, units, SKU, etc.