A small Spark-ready pricing app for sales reps. The deployed runtime is Python/FastAPI so the Zapier MCP call path matches AP-Sparkle's known-working Snowflake bridge.
- Working FastAPI app with a sales rep pricing form.
POST /api/pricevalidates requests with Pydantic.PRICING_PROVIDER=mockworks locally with deterministic sample guidance.PRICING_PROVIDER=zapier-mcpcalls Zapier MCP with the official Python MCP client./api/healthis wired for Spark health checks.Dockerfileforces Spark/Kaniko to deploy the Python app instead of the older Next.js prototype.
pip install .
uvicorn app.main:app --host 0.0.0.0 --port 3000Open http://localhost:3000.
| Name | Required | Description |
|---|---|---|
PRICING_PROVIDER |
Yes | mock or zapier-mcp. Defaults to mock if omitted. |
ZAPIER_MCP_SERVER_URL |
For Zapier MCP | Private Zapier MCP server URL. This usually includes auth in the URL and should be treated like a secret. |
ZAPIER_MCP_URL |
For Zapier MCP | Alias used by AP-Sparkle for the Zapier MCP server URL. |
ZAPIER_MCP_KEY |
For Zapier MCP | Bearer token for Zapier MCP when auth is stored separately from the URL. |
ZAPIER_MCP_TOKEN |
For Zapier MCP | Alias used by AP-Sparkle for the Zapier MCP bearer token. |
ZAPIER_MCP_API |
For Zapier MCP | Bearer token for Zapier MCP when auth is stored separately from the URL. |
ZAPIER_MCP_BEARER_TOKEN |
Optional | Bearer token if your Zapier MCP setup gives auth separately from the URL. |
ZAPIER_MCP_TOOL_NAME |
Optional | Exact Zapier MCP tool name to call. Defaults to snowflake_execute_sql. |
PRICING_MODEL_VERSION |
Optional | Included in mock/API responses for audit and debugging. |
POST /api/price
All fields are optional. Blank form fields are omitted from the request.
{
"accountId": "123456",
"planTier": "Enterprise",
"region": "NA",
"productLine": "Marketing",
"resellerId": "RSID-123",
"contactLimit": 50000,
"listPrice": 50000,
"discountRate": 10,
"smsFlag": true,
"smsCredits": 1000,
"whatsapp": false,
"termLength": 12,
"arr": 42000,
"priceRealization": 0.84
}The UI expects /api/price to return this object under a result key:
{
"quoteId": "Q-123",
"recommendedDiscount": 12,
"maxDiscount": 18,
"floorPrice": 41000,
"recommendedPrice": 44000,
"approvalRequired": false,
"approvalLevel": "None",
"reasonCodes": ["Segment: mid market", "Term: 12 months"],
"modelVersion": "snowflake-2026-05",
"provider": "zapier-mcp",
"calculatedAt": "2026-05-26T12:00:00.000Z"
}Use this to call the same Snowflake-authed Zapier MCP path AP-Sparkle uses.
Spark secrets:
PRICING_PROVIDER=zapier-mcp
ZAPIER_MCP_SERVER_URL=<private Zapier MCP server URL>
ZAPIER_MCP_KEY=<Zapier MCP bearer token>
ZAPIER_MCP_TOOL_NAME=snowflake_execute_sql
The provider calls snowflake_execute_sql with statement, output_hint, and instructions.
The statement is:
CALL AC.SANDBOX.CALCULATE_PRICING_GUIDANCE(
PARSE_JSON($${...pricing request json...}$$)
);- Health check path:
/api/health. - Set
PRICING_PROVIDER=zapier-mcpin Spark to use the Zapier MCP Snowflake connection. - For the MCP bridge, set
PRICING_PROVIDER=zapier-mcpand add theZAPIER_MCP_*secrets above. - Direct Snowflake can be added later behind the same provider interface in
app/pricing.py.