Create Cost Rate Energy Cost

Create a new energy cost interval for a cost rate.

If the cost rate uses dynamic pricing schedules, the energy cost can be associated with a specific schedule by providing cost_rate_schedule_uuid.

Request

  • Method: POST

  • Path: /api/dynamic_pricing/cost_rate_energy_cost

Body parameters

Mandatory:

Name

Type

Description

cost_rate_uuid

string

UUID of the cost rate.

unit

integer

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

price

string|float

Price per unit.

Optional:

Name

Type

Description

cost_rate_schedule_uuid

string|null

UUID of the schedule configuration (recurring or unique pricing config).

Example request

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

Response (200)

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

Error responses

  • 404: Cost rate not found.

{
  "status": "error",
  "message": "Cost rate not found"
}
  • 404: Schedule not found.

{
  "status": "error",
  "message": "Schedule 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"
}