Back to Fulfilment Performance Reporting

Integration and API Spec

The reference during the build: every tool connection, auth scope, field mapping, and error-handling rule.

4 pagesPDF · Technical
FS-DOC-05Technical

Integration and API Spec

Fulfilment Performance Reporting

[YourCompany.com] · Fulfilment Department · Prepared by FullSpec · [Today's Date]

This document is the authoritative integration reference for the Fulfilment Performance Reporting automation. It covers every tool connected to the three-agent workflow, the exact OAuth scopes and API configuration required for each, field-level mappings between handoffs, the orchestration and credential-store layout, and the defined error-handling behaviour for every integration point. The FullSpec team uses this document to build and validate all API connections. Your team uses it to supply credentials and confirm account-tier access before the build begins.

01Tool inventory

Tool
Role in automation
Auth method
Min plan required
Used by agents
Orchestration layer
Hosts all workflow logic, schedules triggers, routes data between agents, and manages retries
N/A (internal)
N/A
All agents
Shopify
Source of order, fulfilment status, and SKU data for the reporting period
OAuth 2.0 (custom app, read-only)
Basic ($29/mo) or higher with API access
Agent 1
ShipStation
Source of shipment dispatch dates, carrier assignments, and delivery confirmations
API key + secret (Basic Auth over HTTPS)
Starter ($9.99/mo) or higher
Agent 1
Xero
Source of credit notes and returns transactions for the reporting period
OAuth 2.0 (PKCE flow, read-only)
Starter or Standard (any paid plan)
Agent 1
Google Sheets
Staging area for raw data, KPI calculation engine, report storage, and historical log
OAuth 2.0 (service account)
Google Workspace or free Google account
Agents 1, 2, 3
Slack
KPI summary distribution channel for the operations team
OAuth 2.0 (Bot Token, incoming webhook)
Free tier or higher with incoming webhooks enabled
Agent 3
Gmail
Full report email delivery to the configured recipient list
OAuth 2.0 (service account or user delegation)
Any Google Workspace account with Gmail enabled
Agent 3
Before you connect anything: sandbox-test every API connection in a non-production environment before supplying live credentials. For Shopify and Xero this means using a development store or demo company. For ShipStation use a test account or a staging API key. For Google Sheets, Slack, and Gmail test against a dedicated workspace or channel before pointing at production. No live credentials should be stored or used until all sandbox tests pass.
Integration and API SpecPage 1 of 4
FS-DOC-05Technical

02Per-tool integration detail

Shopify

Used by the Data Collection Agent (Agent 1) to retrieve all orders placed within the closed reporting period. The automation connects via a Shopify custom app with read-only access. No write operations are performed against Shopify at any point.

Auth method
OAuth 2.0 via Shopify custom app. Generate an Admin API access token in the Shopify Partner Dashboard or directly in the store admin under Apps > Develop apps. Store the access token in the credential store as SHOPIFY_ACCESS_TOKEN. Never hardcode.
Required scopes
read_orders, read_fulfillments, read_products, read_inventory
Webhook / trigger setup
No inbound webhook required. The Data Collection Agent polls the REST Orders API on a schedule. No Shopify webhook registration is needed for this workflow.
Required configuration
Store the shop domain (e.g. yourstore.myshopify.com) as SHOPIFY_SHOP_DOMAIN in the credential store. The reporting date window is injected at runtime from the scheduler. No hardcoded dates.
Rate limits
REST API: 40 requests/second on Basic plan, 80/second on Shopify Plus. At current volume (200-800 orders/period, roughly 4 reports/month) a single paginated orders call with 250 results per page requires at most 4 requests per run. Throttling is not needed at current volume. Implement the Retry-After header check as a precaution for future growth.
Constraints
The Orders API returns a maximum of 250 records per page. Pagination via the Link header must be implemented. Fulfilled orders older than 60 days may require the API version 2024-01 or later. The access token does not expire but must be regenerated if the custom app is reinstalled.
// Endpoint
GET https://{SHOPIFY_SHOP_DOMAIN}/admin/api/2024-01/orders.json
  ?status=any
  &created_at_min={period_start_iso8601}
  &created_at_max={period_end_iso8601}
  &limit=250
  &fields=id,name,created_at,fulfillment_status,fulfilled_at,line_items,financial_status

// Auth header
X-Shopify-Access-Token: {SHOPIFY_ACCESS_TOKEN}

// Output (per order record)
{ id, name, created_at, fulfillment_status, fulfilled_at, line_items[], financial_status }
ShipStation

Used by the Data Collection Agent (Agent 1) to retrieve shipment records for the same reporting window. ShipStation uses API key and secret pairs transmitted as a Base64-encoded Basic Auth header. No write operations are performed.

Auth method
HTTP Basic Auth. Encode API_KEY:API_SECRET in Base64 and pass as the Authorization header. Store as SHIPSTATION_API_KEY and SHIPSTATION_API_SECRET in the credential store. Never hardcode.
Required scopes
ShipStation does not use OAuth scopes. The API key inherits the permission set of the user account it was generated under. The account must have at least read access to Shipments, Orders, and Carriers. Use a dedicated read-only API user where the platform allows it.
Webhook / trigger setup
No inbound webhook required. The agent polls the GET /shipments endpoint on schedule using the shipDate filter range matching the reporting period.
Required configuration
Store SHIPSTATION_API_KEY and SHIPSTATION_API_SECRET in the credential store. Base URL is https://ssapi.shipstation.com. The reporting date range is injected at runtime.
Rate limits
ShipStation enforces a limit of 40 API requests per minute on all paid plans. At current volume (200-800 shipments/period) a paginated call with pageSize=500 requires at most 2 requests per run. Throttling is not required at current volume. Add a 1.5-second delay between paginated calls as a precaution.
Constraints
Maximum pageSize is 500. Pagination is handled via the page parameter. The API returns all shipments regardless of store; filter by storeId if the account manages multiple stores. Voided shipments are included by default; filter by voided=False in the query string.
// Endpoint
GET https://ssapi.shipstation.com/shipments
  ?shipDateStart={period_start_yyyy-mm-dd}
  &shipDateEnd={period_end_yyyy-mm-dd}
  &voided=False
  &pageSize=500
  &page=1

// Auth header
Authorization: Basic {Base64(SHIPSTATION_API_KEY:SHIPSTATION_API_SECRET)}

// Output (per shipment record)
{ shipmentId, orderId, orderNumber, shipDate, deliveryDate, carrierCode,
  trackingNumber, shipmentStatusCode, voided }
Xero

Used by the Data Collection Agent (Agent 1) to retrieve credit notes and returns transactions issued during the reporting period. Xero uses OAuth 2.0 with PKCE. Tokens expire after 30 minutes and must be refreshed using the refresh token stored in the credential store.

Auth method
OAuth 2.0 with PKCE. Register the automation as a connected app in the Xero Developer Portal. Store XERO_CLIENT_ID, XERO_CLIENT_SECRET, XERO_ACCESS_TOKEN, XERO_REFRESH_TOKEN, and XERO_TENANT_ID in the credential store. Implement token refresh logic: access tokens expire after 30 minutes; refresh tokens are valid for 60 days and must be rotated on each use.
Required scopes
accounting.transactions.read, accounting.contacts.read, offline_access
Webhook / trigger setup
No inbound webhook required. The agent calls the Credit Notes API filtered by the reporting period date range on a scheduled poll basis.
Required configuration
Store XERO_TENANT_ID (the organisation identifier, found in the Xero API response after connection) in the credential store alongside token values. The Xero-tenant-id header must be included in every API request.
Rate limits
Xero enforces a limit of 60 API calls per minute and 5,000 calls per day per connected app. At current volume (4 reports/month) the automation makes fewer than 5 calls per run. No throttling required. Implement a 429 response handler with a 60-second backoff.
Constraints
Credit notes must be filtered by Status=AUTHORISED to exclude drafts. The date filter uses the where clause on Date parameter in ISO 8601 format. The access token must be refreshed before each scheduled run to avoid mid-run expiry. Token rotation must persist the new refresh token back to the credential store immediately.
// Endpoint
GET https://api.xero.com/api.xro/2.0/CreditNotes
  ?where=Date>={period_start_iso8601}&&Date<={period_end_iso8601}
  &&Status=="AUTHORISED"

// Auth headers
Authorization: Bearer {XERO_ACCESS_TOKEN}
Xero-tenant-id: {XERO_TENANT_ID}
Accept: application/json

// Output (per credit note record)
{ CreditNoteID, CreditNoteNumber, Date, Status, SubTotal, TotalTax,
  Total, CurrencyCode, Contact.Name, LineItems[] }
Google Sheets

Used by all three agents. Agent 1 writes raw data to the staging sheet. Agent 2 reads staged data, runs KPI formulas, and writes calculated results. Agent 3 reads the final KPI row and writes a new row to the historical log sheet. All access is via the Google Sheets API v4 using a service account.

Auth method
OAuth 2.0 via Google service account. Create a service account in Google Cloud Console, download the JSON key file, and share the target spreadsheet with the service account email address (editor permission). Store GOOGLE_SERVICE_ACCOUNT_JSON (the full JSON key content) in the credential store. Never hardcode the private key.
Required scopes
https://www.googleapis.com/auth/spreadsheets, https://www.googleapis.com/auth/drive.file
Webhook / trigger setup
No webhook. All reads and writes are initiated by the orchestration layer on a schedule or on upstream agent completion.
Required configuration
Store SHEETS_SPREADSHEET_ID (the ID from the sheet URL) in the credential store. The workbook must contain three named sheets: raw_data (Agent 1 write target), kpi_results (Agent 2 write target), and performance_log (Agent 3 append target). Column headers must match the field mappings in Section 03 exactly. KPI threshold values are stored in a config tab named thresholds, not hardcoded in formulas.
Rate limits
Google Sheets API: 300 read/write requests per minute per project, 60 per minute per user. At current volume the automation makes fewer than 20 API calls per run. No throttling required. Implement exponential backoff on 429 responses.
Constraints
Batch writes using the batchUpdate method to minimise API calls. Clear the raw_data sheet before each write to prevent stale rows accumulating. Never delete the header row (row 1). The performance_log sheet is append-only; do not overwrite existing rows.
// Write raw data (Agent 1)
POST https://sheets.googleapis.com/v4/spreadsheets/{SHEETS_SPREADSHEET_ID}/values
     /raw_data!A2:Z{n}:clear
POST https://sheets.googleapis.com/v4/spreadsheets/{SHEETS_SPREADSHEET_ID}/values
     /raw_data!A2:Z{n}?valueInputOption=USER_ENTERED

// Read KPI results (Agent 3)
GET  https://sheets.googleapis.com/v4/spreadsheets/{SHEETS_SPREADSHEET_ID}/values
     /kpi_results!A2:J2

// Append to performance log (Agent 3)
POST https://sheets.googleapis.com/v4/spreadsheets/{SHEETS_SPREADSHEET_ID}/values
     /performance_log!A:J:append?valueInputOption=USER_ENTERED&insertDataOption=INSERT_ROWS
Integration and API SpecPage 2 of 4
FS-DOC-05Technical
Slack

Used by the Report Distribution Agent (Agent 3) to post a formatted KPI summary to the designated operations channel. The automation uses a Slack Bot Token obtained from a registered Slack app with the chat:write scope.

Auth method
OAuth 2.0 Bot Token. Create a Slack app in the Slack API portal, add the required bot scopes, install the app to the workspace, and copy the Bot User OAuth Token. Store as SLACK_BOT_TOKEN in the credential store. Never hardcode.
Required scopes
chat:write, chat:write.public, incoming-webhook
Webhook / trigger setup
Configure an incoming webhook URL during Slack app setup pointing to the target channel. Store as SLACK_WEBHOOK_URL in the credential store. The automation posts via the webhook URL using an HTTP POST with a JSON payload. Verify the webhook signature on any inbound event if Slack event subscriptions are added in future.
Required configuration
Store SLACK_CHANNEL_ID (the channel to post to, e.g. C01234ABCDE) and SLACK_BOT_TOKEN in the credential store. The KPI summary message template is stored in the orchestration layer config, not hardcoded in the workflow step. Recipient channel ID must be confirmed before go-live.
Rate limits
Slack enforces Tier 3 rate limits on chat.postMessage: approximately 1 request per second. At current volume (4 posts per month) no throttling is required.
Constraints
Block Kit JSON payloads must not exceed 50 blocks per message. The KPI summary fits well within this limit. If the message text exceeds 3,000 characters, truncate the commentary and include a link to the full Google Sheet. The bot must be invited to the target channel before the first post.
// Endpoint
POST https://hooks.slack.com/services/{SLACK_WEBHOOK_PATH}

// Payload
{
  "text": "Fulfilment KPI Report: {period_label}",
  "blocks": [
    { "type": "header", "text": { "type": "plain_text", "text": "Fulfilment KPIs - {period_label}" } },
    { "type": "section", "text": { "type": "mrkdwn", "text": "{kpi_summary_markdown}" } },
    { "type": "section", "text": { "type": "mrkdwn", "text": "{commentary_text}" } },
    { "type": "actions", "elements": [{ "type": "button", "text": "View Full Report", "url": "{SHEETS_REPORT_URL}" }] }
  ]
}
Gmail

Used by the Report Distribution Agent (Agent 3) to email the full report link and PDF export to the configured recipient list. Access is via the Gmail API using a Google service account with domain-wide delegation, or a delegated user account.

Auth method
OAuth 2.0 via Google service account with domain-wide delegation. Grant the service account the Gmail send scope in Google Workspace Admin. Alternatively, use a dedicated Gmail user account with an OAuth refresh token. Store GMAIL_SENDER_ADDRESS and GOOGLE_SERVICE_ACCOUNT_JSON (shared with Sheets) in the credential store.
Required scopes
https://www.googleapis.com/auth/gmail.send
Webhook / trigger setup
No inbound webhook. The agent sends email only (outbound). No Gmail watch or Pub/Sub subscription is required for this workflow.
Required configuration
Store GMAIL_RECIPIENT_LIST (comma-separated email addresses) in the credential store, not hardcoded in the workflow. Store GMAIL_SENDER_ADDRESS. The email subject line template and body HTML template are stored in the orchestration layer config. The Google Sheets PDF export URL is injected at runtime from Agent 2 output.
Rate limits
Gmail API: 250 quota units per user per second; sending a single message costs 100 units. At 4 emails per month the rate limit is not a concern. Daily sending limit for Google Workspace accounts is 2,000 messages per day; far above current volume.
Constraints
Attachments must be Base64-encoded in the MIME message. The PDF export from Google Sheets is fetched via the Drive export URL before being attached. Maximum attachment size is 25 MB; fulfilment reports are expected to be well under 5 MB. The sender address must match the delegated account or the domain-wide delegation scope.
// Endpoint
POST https://gmail.googleapis.com/gmail/v1/users/{GMAIL_SENDER_ADDRESS}/messages/send

// Auth header
Authorization: Bearer {GMAIL_ACCESS_TOKEN}

// MIME payload (Base64url-encoded)
From: {GMAIL_SENDER_ADDRESS}
To: {GMAIL_RECIPIENT_LIST}
Subject: Fulfilment Performance Report - {period_label}
Content-Type: multipart/mixed

-- body part: text/html (report summary + Sheets link)
-- attachment part: application/pdf (Base64-encoded PDF export)

03Field mappings between tools

The tables below define the exact field mappings for each agent handoff. Monospace field names must be used verbatim in the orchestration layer config and in the Google Sheets column headers.

Agent 1 handoff: Shopify to Google Sheets (raw_data sheet, orders block, columns A to H)

Source tool
Source field
Destination tool
Destination field
Shopify
id
Google Sheets
order_id
Shopify
name
Google Sheets
order_number
Shopify
created_at
Google Sheets
order_created_at
Shopify
fulfillment_status
Google Sheets
fulfillment_status
Shopify
fulfilled_at
Google Sheets
fulfilled_at
Shopify
financial_status
Google Sheets
financial_status
Shopify
line_items[].sku
Google Sheets
sku_list
Shopify
line_items[].quantity
Google Sheets
quantity_total

Agent 1 handoff: ShipStation to Google Sheets (raw_data sheet, shipments block, columns I to P)

Source tool
Source field
Destination tool
Destination field
ShipStation
shipmentId
Google Sheets
shipment_id
ShipStation
orderNumber
Google Sheets
ss_order_number
ShipStation
shipDate
Google Sheets
ship_date
ShipStation
deliveryDate
Google Sheets
delivery_date
ShipStation
carrierCode
Google Sheets
carrier_code
ShipStation
trackingNumber
Google Sheets
tracking_number
ShipStation
shipmentStatusCode
Google Sheets
shipment_status
ShipStation
voided
Google Sheets
is_voided

Agent 1 handoff: Xero to Google Sheets (raw_data sheet, returns block, columns Q to X)

Source tool
Source field
Destination tool
Destination field
Xero
CreditNoteID
Google Sheets
credit_note_id
Xero
CreditNoteNumber
Google Sheets
credit_note_number
Xero
Date
Google Sheets
return_date
Xero
Total
Google Sheets
return_value_usd
Xero
SubTotal
Google Sheets
return_subtotal_usd
Xero
Contact.Name
Google Sheets
customer_name
Xero
Status
Google Sheets
credit_note_status
Xero
LineItems[].Description
Google Sheets
return_item_description

Agent 2 handoff: Google Sheets (kpi_results sheet) to Agent 3 distribution payload

Source tool
Source field
Destination tool
Destination field
Google Sheets
on_time_dispatch_rate
Slack payload + Gmail body
kpi_on_time_dispatch
Google Sheets
fill_rate
Slack payload + Gmail body
kpi_fill_rate
Google Sheets
avg_dispatch_lead_time_days
Slack payload + Gmail body
kpi_avg_lead_time
Google Sheets
returns_rate
Slack payload + Gmail body
kpi_returns_rate
Google Sheets
period_label
Slack payload + Gmail body
period_label
Google Sheets
commentary_text
Slack payload + Gmail body
commentary_text
Google Sheets
report_sheet_url
Gmail body + Slack button
SHEETS_REPORT_URL
Google Sheets
pdf_export_url
Gmail attachment fetch
pdf_export_url

Agent 3 handoff: distribution confirmation to Google Sheets (performance_log sheet, append row)

Source tool
Source field
Destination tool
Destination field
Orchestration layer
period_label
Google Sheets
log_period
Google Sheets (kpi_results)
on_time_dispatch_rate
Google Sheets (performance_log)
log_on_time_dispatch
Google Sheets (kpi_results)
fill_rate
Google Sheets (performance_log)
log_fill_rate
Google Sheets (kpi_results)
avg_dispatch_lead_time_days
Google Sheets (performance_log)
log_avg_lead_time
Google Sheets (kpi_results)
returns_rate
Google Sheets (performance_log)
log_returns_rate
Orchestration layer
run_timestamp
Google Sheets (performance_log)
log_run_timestamp
Orchestration layer
distribution_status
Google Sheets (performance_log)
log_distribution_status
Integration and API SpecPage 3 of 4
FS-DOC-05Technical

04Build stack and orchestration

Orchestration layout
Three separate workflows, one per agent: Data Collection Workflow (Agent 1), KPI and Commentary Workflow (Agent 2), and Report Distribution Workflow (Agent 3). Each workflow is independently scoped and versioned. All three share a single centralised credential store. Agents chain via a completion-event trigger: Agent 1 emits a success signal consumed by Agent 2; Agent 2 emits a success signal consumed by Agent 3.
Agent 1 trigger mechanism
Scheduled poll. Fires on a cron schedule (default: every Monday at 07:00 local time, and on the first day of each month at 07:00 for monthly cycles). No inbound webhook. The schedule is configurable in the orchestration layer without code changes. At trigger time, the reporting period start and end dates are computed from the schedule parameters and injected into all downstream API calls.
Agent 2 trigger mechanism
Completion event from Agent 1. Agent 1 writes a status value of COMPLETE to the raw_data sheet's status cell (A1) and emits an internal platform event. Agent 2 listens for this event via the platform's internal messaging bus. No external webhook. If Agent 1 fails, no event is emitted and Agent 2 does not fire.
Agent 3 trigger mechanism
Completion event from Agent 2. Agent 2 writes the commentary_approved flag and the kpi_results range, then emits an internal platform event. If the human review gate is active, Agent 3 waits for an approval signal (a manual platform button click by the Ops Manager) before proceeding. Approval timeout is set to 4 hours; after timeout the run is logged as PENDING_REVIEW and a reminder Slack DM is sent to the Ops Manager.
Signature validation
No inbound webhooks are used in this workflow, so signature validation is not applicable at this stage. If Shopify or Slack event subscriptions are added in future, implement HMAC-SHA256 signature verification on all inbound webhook payloads before processing.
Credential store
A centralised secrets manager provided by the orchestration platform. All credentials are referenced by environment variable name. No credential value is written into workflow step configuration or version control. The credential store contents are listed in the code block below.
Credential store contents. All values are injected by the orchestration platform at runtime. Rotate tokens on the schedule specified per tool above.
// Credential store contents (all values injected at runtime as environment variables)
// Do NOT hardcode any of these values in workflow step configuration.

// Shopify
SHOPIFY_ACCESS_TOKEN        = '<custom-app-admin-api-token>'
SHOPIFY_SHOP_DOMAIN         = '<yourstore.myshopify.com>'

// ShipStation
SHIPSTATION_API_KEY         = '<shipstation-api-key>'
SHIPSTATION_API_SECRET      = '<shipstation-api-secret>'

// Xero
XERO_CLIENT_ID              = '<xero-connected-app-client-id>'
XERO_CLIENT_SECRET          = '<xero-connected-app-client-secret>'
XERO_ACCESS_TOKEN           = '<current-access-token>'          // refreshed every run
XERO_REFRESH_TOKEN          = '<current-refresh-token>'          // rotated on each use
XERO_TENANT_ID              = '<xero-organisation-tenant-id>'

// Google (Sheets + Gmail, shared service account)
GOOGLE_SERVICE_ACCOUNT_JSON = '<full-json-key-file-content>'
SHEETS_SPREADSHEET_ID       = '<google-sheets-document-id>'
SHEETS_REPORT_URL           = '<shareable-link-to-report-sheet>'
GMAIL_SENDER_ADDRESS        = '<sender@yourdomain.com>'
GMAIL_RECIPIENT_LIST        = '<comma-separated-recipient-emails>'

// Slack
SLACK_BOT_TOKEN             = '<xoxb-slack-bot-token>'
SLACK_WEBHOOK_URL           = '<https://hooks.slack.com/services/...>'
SLACK_CHANNEL_ID            = '<C01234ABCDE>'

// Orchestration config (non-secret but stored centrally)
REPORTING_SCHEDULE_CRON     = '0 7 * * 1'                       // every Monday 07:00
MONTHLY_SCHEDULE_CRON       = '0 7 1 * *'                       // 1st of month 07:00
APPROVAL_TIMEOUT_HOURS      = '4'
KPI_THRESHOLDS_TAB_NAME     = 'thresholds'

05Error handling and retry logic

Every integration point has a defined failure behaviour. Unhandled exceptions must never fail silently. If a retry sequence is exhausted without success, the run must log the failure, alert the Ops Manager via Slack DM, and halt cleanly without partial data reaching the report sheet.

Integration
Scenario
Required behaviour
Shopify Orders API
HTTP 429 rate limit response
Read the Retry-After header value. Wait the specified number of seconds (typically 2 to 10) then retry. Retry up to 5 times with exponential backoff (2s, 4s, 8s, 16s, 32s). If all retries fail, log the error, alert Ops Manager via Slack DM, and halt the run. Do not proceed to ShipStation with incomplete order data.
Shopify Orders API
HTTP 401 or 403 (invalid or expired token)
Log the authentication failure immediately. Do not retry. Alert the FullSpec support channel and the Ops Manager. Halt the run. The access token must be regenerated manually in the Shopify custom app settings before the next scheduled run.
ShipStation API
HTTP 429 rate limit response
Pause for 60 seconds (one full rate-limit window) then retry the failed request. Retry up to 3 times. Add a 1.5-second inter-page delay for all paginated calls to prevent hitting the 40 requests/minute ceiling. If retries exhausted, log, alert, and halt.
ShipStation API
HTTP 503 or connection timeout
Retry immediately once, then wait 30 seconds and retry again. If the third attempt fails, log the error with the full response body, alert the Ops Manager, and halt. Do not proceed to Xero with missing shipment data.
Xero API
Access token expired mid-run (HTTP 401)
Detect the 401 response, trigger the token refresh flow using XERO_REFRESH_TOKEN, persist the new access token and refresh token back to the credential store, then immediately retry the failed request once. If refresh fails (invalid refresh token), halt, log, and alert. Do not silently continue with a stale token.
Xero API
Refresh token expired (60-day rotation missed)
Log a CRITICAL error. Alert the Ops Manager and the FullSpec team via Slack DM and email. Halt the run. Re-authorisation requires a manual OAuth flow in the Xero Developer Portal to obtain a new refresh token. Update the credential store before the next run.
Google Sheets API
HTTP 429 quota exceeded on write
Implement exponential backoff: wait 5s, 10s, 20s, 40s between retries. Retry up to 4 times. Use batchUpdate to minimise total request count. If all retries fail, log the error, alert the Ops Manager, and halt. Do not leave a partially written raw_data sheet; clear the sheet before retrying the full write.
Google Sheets API
Spreadsheet structure changed (unexpected column layout)
Before writing, validate that the raw_data sheet contains the expected header row in row 1. If headers do not match the field mapping spec exactly, halt, log a STRUCTURE_MISMATCH error with the detected vs expected headers, and alert the Ops Manager. Do not write data into a mismatched sheet.
Slack webhook
Webhook URL returns HTTP 404 or 410 (webhook revoked or channel deleted)
Log the failure. Retry once after 30 seconds. If the second attempt fails, fall back to sending the KPI summary as a plain-text Gmail email to the Ops Manager address. Alert the FullSpec team to reconfigure the webhook URL. Do not suppress the report distribution entirely.
Gmail API
HTTP 401 (service account delegation revoked)
Log the authentication failure. Do not retry. Alert the Ops Manager via Slack DM. The full report has already been written to Google Sheets; include the direct Sheets link in the Slack alert so the team can access the report manually while the Gmail credential is restored.
Gmail API
PDF export fetch fails (Drive export URL returns 403 or timeout)
Retry the PDF export fetch up to 3 times with 10-second gaps. If export still fails, send the email without the PDF attachment but include the direct Google Sheets link in the email body. Log the attachment failure and alert the Ops Manager. Never block the email send because of a failed attachment.
Orchestration layer (all agents)
Unhandled exception or unexpected runtime error
Catch all unhandled exceptions at the workflow level. Log the full stack trace and the step identifier where the exception occurred. Send an alert to the Ops Manager via Slack DM and to support@gofullspec.com. Mark the run status as FAILED in the performance_log sheet with the error reason. Never fail silently.
All error alerts sent to the Ops Manager must include: the run timestamp, the period being reported, the step that failed, the error code or message, and a link to the relevant credential or configuration item to check. Generic alerts without this context are not acceptable. Contact support@gofullspec.com for any integration issue that cannot be resolved by credential rotation or configuration correction.
Integration and API SpecPage 4 of 4

More documents for this process

Every document generated for Fulfilment Performance Reporting.

Launch Plan
Operations · Owner
View
ROI and Business Case
Finance · Owner
View
Process Runbook / SOP
Operations · Owner
View
Developer Handover Pack
Technical · Developer
View
Test and QA Plan
Quality · Developer
View