---
title: "Create a price rule for a package"
method: POST
path: "/shop/packages/{packageId}/price-rules"
tags: ["Packages"]
---

# Create a price rule for a package

`POST /shop/packages/{packageId}/price-rules`

Adds a new `PriceRule` to a `Package`. Combine date ranges, time
windows and weekday filters to express most pricing scenarios —
peak vs off-peak, weekday vs weekend, seasonal overrides. The first
rule whose conditions match a given booking wins. Sending no
filters creates a fallback "always applies" rule.

`date_from` defaults to today in the site's timezone when omitted. When
`offering_standard_price` is enabled for the site, the package's
`standard_price` must be set before a price rule can be created. A zero
amount counts as set. Requires the `SETTINGS_MANAGE` permission on the
package's site.

## Request body

- object
  - `price` integer, required — Price in the smallest currency unit (e.g. pence, cents). `20000` means £200.00 in a GBP-denominated site.
  - `date_from` string, date, nullable — First date this rule applies (inclusive). Defaults to today in the site's timezone when omitted.
  - `date_to` string, date, nullable — Last date this rule applies (inclusive). When omitted, the rule has no end date.
  - `time_from` string, nullable — Start of the time-of-day window in 24-hour `HH:MM` format. When `time_to` is set, must be earlier than `time_to` (the rule does not wrap past midnight).
  - `time_to` string, nullable — End of the time-of-day window in 24-hour `HH:MM` format. Must be later than `time_from` if both are set.
  - `weekdays` string[] — Days of the week this rule applies on. Empty / omitted means every day.

## Response `201`

A single `PriceRule` belonging to a `Package`.

- object
  - `data` SchemasPriceRule, required
    - `id` string, object-id — The ID of the price rule.
    - `price` integer — The price applied by this rule
    - `date_from` string, date, nullable — The first date this rule should be applied.
    - `date_to` string, date, nullable — The last date this rule should be applied.
    - `weekdays` string[] — The weekdays this rule should be applied.
    - `time_from` string, nullable — This rule will be applied to bookings starting on or after this time.
    - `time_to` string, nullable — This rule will be applied to bookings starting before this time.
    - `duration` integer, nullable — This rule will be applied to bookings of this duration.

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `404` — The resource couldn't be found
- `422` — The request didn't pass validation

---

[API](https://skmtc.dev/try/apis/trybe-api.md) · [All operations](https://skmtc.dev/try/apis/trybe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/try/trybe-api/revisions/f37f92702da5/schema)
