Market Supply Points
API reference for discovering and resolving market supply point descriptors
fetchMarketSupplyPoints
Fetches market supply agreements for an account and resolves the supply points
that belong to a property. The returned value is a flat array of
MarketSupplyPoint descriptors. Each descriptor includes the supply point ID,
the resolved utility, and the source market name when available.
import { fetchMarketSupplyPoints } from "@octopus-energy/measurements/market-supply-points";fetchMarketSupplyPointsProp
Type
const marketSupplyPoints = await fetchMarketSupplyPoints(client, {
accountNumber,
propertyId,
utilityMarkets,
});MarketSupplyPointsOptionsProp
Type
The underlying marketSupplyAgreements query uses cursor pagination. Configure
agreements.pageSize to control the number of agreement edges requested per
page. The default is 100, and the maximum is 100. The helper fetches all
pages before resolving the MarketSupplyPoint[] array.
Invalid page sizes throw MeasurementsError with code INVALID_OPTIONS. Cursor
failures use PAGINATION_CURSOR_NOT_ADVANCED or
PAGINATION_PAGE_LIMIT_EXCEEDED. GraphQL transport failures are normalized to
REQUEST_FAILED, and invalid API payloads are normalized to INVALID_RESPONSE
with the original error in cause.
The returned array contains one item for each matching supply point. Descriptors
can be passed directly to
groupMeasurements(records, { matching: marketSupplyPoints }) for supply-point
level grouping. See MarketSupplyPoint for the full
shape.
Throws MeasurementsError with code MARKET_SUPPLY_POINT_IDS_NOT_FOUND when no
matching supply points are found. Results are sorted by utility, then by supply
point ID: electricity supply points first, ordered by marketSupplyPointId,
followed by gas supply points ordered by marketSupplyPointId.
resolveMarketSupplyPoints
Pure utility function that resolves a raw marketSupplyAgreements response into
MarketSupplyPoint[]. It returns an empty array when no matching supply points
are found. It is exported for custom data flows that need to distinguish empty
results from thrown fetch/query errors.
import { resolveMarketSupplyPoints } from "@octopus-energy/measurements/market-supply-points";resolveMarketSupplyPointsProp
Type
getMarketSupplyPointUtilities
Returns the unique utilities represented by a market supply point array.
import { getMarketSupplyPointUtilities } from "@octopus-energy/measurements/market-supply-points";
const utilities = getMarketSupplyPointUtilities(marketSupplyPoints);Types
MarketSupplyPointProp
Type
UtilityMarketsProp
Type