errors array in the response body. You need to handle both patterns in your integration.
HTTP errors
HTTP errors occur at the transport layer and mean the API never processed your GraphQL query. These are the only situations in which the API returns a non-200 HTTP status.GraphQL errors
Query and validation errors do not cause an HTTP error status. Instead, the API returns HTTP 200 with anerrors array at the top level of the response body. The data field will be null or partially populated depending on which field failed.
Common validation errors
The table below lists the specific error messages the API returns for known input problems.Nullable fields
Some fields onResidentialPlan and UtilityAccount are nullable by design. Their absence from a response is not an error — it simply means the data is not available for that particular plan or account. Do not treat a null value on these fields as a failure condition.
Nullable fields on ResidentialPlan:
earlyTerminationFeeUsd— not all plans carry an ETF dollar amountearlyTerminationFeeType— ETF structure may be undeterminedminimumStartDate— start date window may be open-endedmaximumStartDate— start date window may be open-endedutilityCode— may not be populated for all service territoriesstateCode— may not be populated for all planscreatedAt— catalog entry timestamp may be absent for older planssupplierScores— the entire object isnullwhen the supplier has no ratings on file; individual score categories within the object (powerHqRating,plansAndRates,customerService,renewablePlans,pucRating) may also be independentlynull
documents[]— a plan may have no attached regulatory documentsfeeBreakdown[].rules— a fee may have no supplementary rule entriestags[]— a plan may carry no descriptive tags
Always code defensively when reading these fields. Check for
null before accessing nested properties on supplierScores, and handle empty arrays in documents, rules, and tags without treating them as errors.Handling errors in your integration
Follow these practices to build a resilient integration with the PowerHQ API. Always checkerrors before processing data. After every API call, inspect the top-level errors key in the response body before you attempt to read from data. If errors is present and non-empty, handle the error condition first.
message string in each error object contains the most actionable diagnostic detail available. Write it to your server logs so you can diagnose issues without needing to reproduce them interactively.
Do not expose raw API error messages to end users. Error messages like "Invalid zipcode 1234" are intended for developers. Map them to user-friendly copy in your application layer — for example, “We couldn’t find plans for that ZIP code. Please check the ZIP code and try again.”
Handle unknown enum values gracefully. The API may introduce new enum values in future versions. Treat any unrecognized enum value as a fallback case rather than an error to avoid breaking your integration when the schema evolves.