Update Cost Rate Energy Cost

Update an existing energy cost interval.

Request

  • Method: PUT

  • Path: /api/dynamic_pricing/cost_rate_energy_cost

Body parameters

Mandatory:

Name

Type

Description

uuid

string

UUID of the energy cost interval to update.

unit

integer

Energy unit in Wh (e.g. 1 = per Wh).

price

string|float

Price per unit.

Example request

curl --location --request PUT \
'https://example.beenergised.cloud/api/dynamic_pricing/cost_rate_energy_cost' \
--header 'x-api-token: <your_token>' \
--header 'Content-Type: application/json' \
--data '{
  "uuid": "<INTERVAL_UUID>",
  "unit": 1,
  "price": "0.30"
}'

Response (200)

{
  "status": "ok",
  "message": "Energy cost was successfully updated.",
  "uuid": "29ccce27-3a3a-4308-831a-ed68b460e3bf"
}

Error responses

  • 404: Energy cost interval not found.

{
  "status": "error",
  "message": "Cost rate interval not found"
}
  • 400: Duplicate energy cost interval (same unit already exists).

{
  "status": "error",
  "message": "Energy cost interval already exists"
}
  • 500: Generic server error.

{
  "status": "error",
  "message": "Internal Server Error"
}