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: .. list-table:: :widths: 25 15 60 :header-rows: 1 * - 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: .. list-table:: :widths: 25 15 60 :header-rows: 1 * - Name - Type - Description * - cost_rate_schedule_uuid - string|null - UUID of the schedule configuration (recurring or unique pricing config). **Example request** .. code-block:: bash curl --location --request POST \ 'https://example.beenergised.cloud/api/dynamic_pricing/cost_rate_energy_cost' \ --header 'x-api-token: ' \ --header 'Content-Type: application/json' \ --data '{ "cost_rate_uuid": "", "unit": 1, "price": "0.25" }' **Response (200)** .. code-block:: json { "status": "ok", "message": "Energy cost was successfully created.", "uuid": "29ccce27-3a3a-4308-831a-ed68b460e3bf" } **Error responses** - ``404``: Cost rate not found. .. code-block:: json { "status": "error", "message": "Cost rate not found" } - ``404``: Schedule not found. .. code-block:: json { "status": "error", "message": "Schedule not found" } - ``400``: Duplicate energy cost interval (same unit already exists). .. code-block:: json { "status": "error", "message": "Energy cost interval already exists" } - ``500``: Generic server error. .. code-block:: json { "status": "error", "message": "Internal Server Error" }