Skip to main content
Use this sandbox flow to evaluate proposal-stage solar and storage economics before creating production customer records. It uses public WattShift APIs, public sandbox credentials, and live utility/rate-plan discovery.

Sandbox Scope Matrix

1. Request Sandbox Access

Create or sign in to a sandbox account from Get API Key, then create a sandbox key with the scopes needed for the flow. For an automated agent credential flow, request these scopes:
If battery:estimate is granted, continue through the battery savings step after creating or selecting a sandbox home with the chosen rate plan. Use only the sandbox API base for the calls below. The agent credential response identifies its environment as sandbox and does not include an API base URL. Use the documented sandbox base for either a manually created sandbox key or a sandbox agent credential; do not send it to the production API. Load your key securely as SANDBOX_API_KEY before running the examples.

2. Look Up Utility And Rate Plans

Use a ZIP code in the target service territory and ask for solar-aware ordering.
Choose a specific rate plan from ratePlans[] that is supported for your quote period. Discovery can return PG&E E-ELEC or NBT plans that are not supported for the requested billing period or context.
  • Use ratePlans[].id as ratePlanId in WattShift API paths and request bodies.
  • Use ratePlans[].rateID as the semantic tariff reference for display and audit trails.
  • Inspect solarBillingProgram and exportCompensationRefs for export coverage. Even a ready export profile does not qualify import-side baseline billing.

3. Calculate A Quote-Stage Bill

Use the no-home rate-plan period route when the proposal has a selected tariff but should not persist a home yet. Quote-stage requests must cover complete calendar months or complete calendar years: startDate must be the first day of a month, and endDate must be the first day of a later month (exclusive). The selected plan needs an effective tariff edition for the entire period. If the tariff requires whole-period baseline qualification, request exactly one qualified calendar month.
july-period-bill.json must be strict JSON with one 96-value daily array for every day in July. This example is an import-only quote. For tariffs that require whole-period baseline qualification, omit the export field entirely; an explicit zero-filled array can still trigger a qualification hold:
On success, the response contains billTotal, startDate, and endDate, plus exportCompensationCredit where applicable. This request is a payload example, not a verified quote for any E-ELEC or NBT variant. The total depends on the selected tariff edition and interval data. A successful quote is an estimate, not an invoice, even if the response has none of the scope or unbilled-charge fields below. Check unbilledCharges for charges the calculator omitted or approximated. If conditionalScope is present or servingQualification is source-scoped-core-only, the total covers only the supported tariff core. Review any conditionalScope.externalComponents and externalExclusions before relying on the total. For nonzero NBT exports priced by an external compensation profile, use a supported home-backed bill request with a qualifying ZIP code in supported inline or stored home context. This no-home example is import-only.
  • 400 RATE_PLAN_EFFECTIVE_HISTORY_REQUIRED: The API could not resolve an effective tariff edition from the selected plan for the requested dates. Choose a revision or period with supported history.
  • 422 BASELINE_PERIOD_QUALIFICATION_REQUIRED: The selected tariff requires verified baseline inputs and a supported estimate context. This can occur even with zero exports. Use a supported tariff and period, or share the selected plan ID and dates with WattShift support.

4. Calculate Battery Savings

Battery estimated savings is home-backed:
Use calendar month numbers for months, where 1 is January and 12 is December. The sandbox credential must include battery:estimate for this step. A plan that supports a quote-stage bill may not support battery estimates. Battery estimates use interval prices; tariffs requiring whole-period baseline qualification may return 422 BASELINE_PERIOD_QUALIFICATION_REQUIRED instead.