Skip to content

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. Returns ConnectionTestResponse containing spreadsheet_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. Uses Sheets_Manager.get_checkers_for_month / get_inbounds_for_date.
  • POST /confirmations/bulk-update — Bulk update confirmation statuses. Body: BulkConfirmationUpdate with updates: [ { row: <int>, status: "SUCCESS"|"FAIL" } ].

Implementation

Operational notes

  • Sheets_Manager uses stored Google credentials (via credential_id) and current SheetSettings (DB id 2 is used in the service). Use test-connection to 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.