Step 3 — Generate BigQuery SQL from confirmed mappings
Source Creator
Step 3 — Generate BigQuery SQL from confirmed mappings
POST /source-creator/generate-queries
POST
Step 3 — Generate BigQuery SQL from confirmed mappings
This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
POST /source-creator/generate-queries Description: Generates the sales-data view query, royalty-sum query, and row-count query from the session’s confirmed mappings. Auto-derivestableNameFormat from the source name and the resolved
accounting/sale period-source mode (column/filename/none)
unless explicitly overridden. For “copy & modify” sessions
(parentSourceId set), also infers transform patterns (exchange-rate
join, COALESCE quantity fallback, nullIf, DSP override) from the
parent source’s SQL and computes a versioned tableNameFormat.
AI-calling — rate limited via aiRateLimitMiddleware. (Query
building itself runs synchronously through QueryBuilderService,
not an AI call, but the route carries the same limiter as
ai-map-columns.)
Authorization:
- Required role:
adminor higher
Code Examples
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Body
application/json
Explicit BigQuery table-name template override. Auto-derived from source name + period-source mode when omitted.
Overrides the auto-inferred accounting-period source mode.
Available options:
column, filename, none Overrides the auto-inferred sale-period source mode.
Available options:
column, filename, none