openapi: 3.1.0 info: title: Gridshare Customer Devices Periodical Tariffs API description: 'The Gridshare Customer API is the homeowner-delegated surface of Lunar Energy''s Gridshare DERMS platform. It allows partners — apps, installers, retailers — to read or control devices on behalf of a specific Lunar Energy customer once that customer has granted consent via OAuth 2.0 Authorization Code flow against the lunar-customer Amazon Cognito user pool. Four scopes are available: `lunar/device.read`, `lunar/device.write`, `lunar/plan.read`, `lunar/plan.write`. ' version: v1.0 contact: name: Lunar Energy url: https://www.gridshare.com email: developers@gridshare.com x-logo: url: https://www.lunarenergy.com/favicon.ico servers: - url: https://developer-api.customer.mygridshare.com description: Production server - url: https://developer-api.customer.dev0.mygridshare.com description: Development server security: - bearerAuth: [] tags: - name: Periodical Tariffs description: Manage periodical (recurring) tariffs paths: /api/v1/periodicaltariffs: get: operationId: listPeriodicalTariffs summary: List Periodical Tariffs description: List all periodical tariffs. tags: - Periodical Tariffs responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PeriodicalTariffList' post: operationId: createPeriodicalTariff summary: Create Periodical Tariff tags: - Periodical Tariffs requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PeriodicalTariff' responses: '201': description: Created /api/v1/periodicaltariffs/{tariffId}: parameters: - $ref: '#/components/parameters/TariffId' get: operationId: getPeriodicalTariff summary: Get Periodical Tariff tags: - Periodical Tariffs responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PeriodicalTariff' patch: operationId: updatePeriodicalTariff summary: Update Periodical Tariff description: 'Update properties of an existing periodical tariff. Append or rewrite pricing periods. Tariffs may have an open-ended latest period; PATCH-ing in a later period closes it automatically. ' tags: - Periodical Tariffs requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PeriodicalTariff' responses: '200': description: OK components: schemas: PeriodicalTariffList: type: object properties: entries: type: array items: $ref: '#/components/schemas/PeriodicalTariff' PricingPeriod: type: object properties: start: type: string format: date end: type: string format: date rates: type: array items: type: object properties: dayOfWeek: type: string from: type: string to: type: string price: type: number exceptions: type: array items: $ref: '#/components/schemas/TariffExceptionPeriod' TariffExceptionPeriod: type: object properties: start: type: string format: date end: type: string format: date rate: type: number PeriodicalTariff: type: object required: - name - companyName properties: tariffId: type: string name: type: string companyName: type: string currency: type: string pricingPeriods: type: array items: $ref: '#/components/schemas/PricingPeriod' parameters: TariffId: in: path name: tariffId required: true schema: type: string securitySchemes: bearerAuth: type: oauth2 description: 'OAuth 2.0 Authorization Code flow against the lunar-customer Amazon Cognito user pool. ' flows: authorizationCode: authorizationUrl: https://lunar-customer-prod-us-west-1.auth.us-west-1.amazoncognito.com/oauth2/authorize tokenUrl: https://lunar-customer-prod-us-west-1.auth.us-west-1.amazoncognito.com/oauth2/token refreshUrl: https://lunar-customer-prod-us-west-1.auth.us-west-1.amazoncognito.com/oauth2/token scopes: lunar/device.read: Read device metadata and telemetry (excluding plans) lunar/device.write: Modify devices including operation mode lunar/plan.read: Read existing device plans lunar/plan.write: Send plans to a device