Create Recurring Pricing Config

Create a new recurring (weekday-based) pricing schedule for a cost rate. The cost rate must have dynamic_pricing set to 1 (recurring per weekday). The request must include the cost rate UUID, a schedule name, one or more weekdays, and a time range. On success, the response returns the created schedule.

Request

  • Method: POST

  • Path: /api/dynamic_pricing/recurring_pricing_config

Body parameters

Mandatory:

Name

Type

Description

cost_rate_uuid

string

UUID of the cost rate to create the schedule for.

name

string

Name of the recurring schedule.

weekday

array of integers

Weekdays the schedule applies to. 1 = Monday … 7 = Sunday.

start_time

string

Start time in H:i format (e.g., 18:00).

end_time

string

End time in H:i format (e.g., 22:00).

Example request

curl --location --request POST 'https://example.beenergised.cloud/api/dynamic_pricing/recurring_pricing_config' \
--header 'x-api-token: <your_token>' \
--header 'Content-Type: application/json' \
--data '{
  "cost_rate_uuid": "<COST_RATE_UUID>",
  "name": "Weekday Evening",
  "weekday": [1, 2, 3],
  "start_time": "18:00",
  "end_time": "22:00"
}'

Response (200)

{
  "status": "success",
  "data": {
    "uuid": "<SCHEDULE_UUID>",
    "name": "Weekday Evening",
    "configs": [
      {
        "weekday": 1,
        "start_time": "18:00",
        "end_time": "22:00"
      },
      {
        "weekday": 2,
        "start_time": "18:00",
        "end_time": "22:00"
      },
      {
        "weekday": 3,
        "start_time": "18:00",
        "end_time": "22:00"
      }
    ]
  }
}

Error responses

  • 404: Cost rate not found.

{
  "status": "error",
  "message": "Cost rate not found"
}
  • 400: Validation error (e.g., the cost rate does not use recurring weekday pricing).

{
  "status": "error",
  "message": "<validation message>"
}
  • 500: Generic server error.

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