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: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.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[].idasratePlanIdin WattShift API paths and request bodies. - Use
ratePlans[].rateIDas the semantic tariff reference for display and audit trails. - Inspect
solarBillingProgramandexportCompensationRefsfor 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:
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: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.