---
title: "Update the title of a price rule"
method: PUT
path: "/admin/price_rules/{price_rule_id:(?:\\\\d+)}.json"
tags: ["PriceRule"]
---

# Update the title of a price rule

`PUT /admin/price_rules/{price_rule_id:(?:\\d+)}.json`

Updates an existing a price rule

## Request body

- PriceRuleSwaggerResponse
  - `price_rule` PriceRuleDto
    - `allocation_limit` integer
    - `allocation_method` string — The allocation method of the price rule. Valid values: * **each**: The discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15. * **across**: The calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items. When the value of `target_type` is `shipping_line`, then this value must be `each`.
    - `created_at` string — The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the price rule was created.
    - `customer_selection` string — The customer selection for the price rule. Valid values: * **all**: The price rule is valid for all customers. * **prerequisite**: The customer must either belong to one of the customer saved searches specified by `prerequisite_saved_search_ids` , or be one of the customers specified by ```prerequisite_customer_ids```.
    - `ends_at` string — The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the price rule ends. Must be after starts_at.
    - `entitled_collection_ids` integer[] — A list of IDs of collections whose products will be eligible to the discount. It can be used only with target_type set to line_item and target_selection set to entitled. It can't be used in combination with entitled_product_ids or entitled_variant_ids.
    - `entitled_country_ids` integer[] — A list of IDs of shipping countries that will be entitled to the discount. It can be used only with target_type set to shipping_line and target_selection set to entitled.
    - `entitled_product_ids` integer[] — A list of IDs of products that will be entitled to the discount. It can be used only with `target_type` set to `line_item` and `target_selection` set to `entitled`. ``` If a product variant is included in entitled_variant_ids, then entitled_product_ids can't include the ID of the product associated with that variant.```
    - `entitled_variant_ids` integer[] — A list of IDs of product variants that will be entitled to the discount. It can be used only with target_type set to line_item and target_selection set to entitled.
    - `id` integer — The ID for the price rule.
    - `maximum_discount_amount` number — maximum discount use
    - `once_per_customer` boolean — Whether the generated discount code will be valid only for a single use per customer. This is tracked using customer ID.
    - `prerequisite_collection_ids` integer[] — List of collection ids that will be a prerequisites for a Buy X Get Y discount. The entitled_collection_ids can be used only with: * target_type set to line_item, * target_selection set to entitled, * allocation_method set to each and * prerequisite_to_entitlement_quantity_ratio defined. Cannot be used in combination with prerequisite_product_ids or prerequisite_variant_ids.
    - `prerequisite_customer_ids` integer[] — List of variant ids that will be a prerequisites for a Buy X Get Y type discount. The entitled_variant_ids can be used only with: * target_type set to line_item, * target_selection set to entitled, * allocation_method set to each and * prerequisite_to_entitlement_quantity_ratio defined.
    - `prerequisite_emails` string[] — List of emails that will be a prerequisite for a discount
    - `prerequisite_product_ids` integer[] — List of product ids that will be a prerequisites for a Buy X Get Y type discount. The prerequisite_product_ids can be used only with: * target_type set to line_item, * target_selection set to entitled, * allocation_method set to each and * prerequisite_to_entitlement_quantity_ratio defined.
    - `prerequisite_quantity_range` QuantityRange
      - `greater_than_or_equal_to` number
    - `prerequisite_shipping_price_range` ShippingPriceRange
      - `less_than_or_equal_to` number
    - `prerequisite_subtotal_range` SubtotalRange
      - `greater_than_or_equal_to` number
    - `prerequisite_to_entitlement_quantity_ratio` ToEntitlementQuantityRatio
      - `entitled_quantity` number
      - `prerequisite_quantity` number
    - `prerequisite_variant_ids` integer[] — List of variant ids that will be a prerequisites for a Buy X Get Y type discount. The entitled_variant_ids can be used only with: * target_type set to line_item, * target_selection set to entitled, * allocation_method set to each and * prerequisite_to_entitlement_quantity_ratio defined.
    - `quota_per_customer` integer — Limit use a customer
    - `quota_per_store` integer — Limit use a store
    - `shop_id` integer
    - `starts_at` string — The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the price rule starts.
    - `status` string
    - `target_selection` string — The target selection method of the price rule. Valid values: * **all**: The price rule applies the discount to all line items in the checkout. * **entitled**: The price rule applies the discount to selected entitlements only.
    - `target_type` string — The target type that the price rule applies to. Valid values: * **line_item**: The price rule applies to the cart's line items. * **shipping_line**: The price rule applies to the cart's shipping lines.
    - `title` string — The title of the price rule. This is used by the ShopBase admin search to retrieve discounts. It is also displayed on the **Discounts** page of the ShopBase admin for bulk discounts. For non-bulk discounts, the discount code is displayed on the admin. For a consistent search experience, use the same value for title as the code property of the associated discount code.
    - `total_redemption` integer — Total amount used discount
    - `total_sale_count` number — Total discount sale count
    - `type` string
    - `updated_at` string — The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the price rule was updated.
    - `usage_count` integer
    - `usage_limit` integer — The maximum number of times the price rule can be used, per discount code.
    - `value` number — The value of the price rule. If if the value of target_type is shipping_line, then only -100 is accepted. The value must be negative.
    - `value_type` string — The value type of the price rule. Valid values: * **fixed_amount**: Applies a discount of value as a unit of the store's currency. For example, if value is -30 and the store's currency is USD, then $30 USD is deducted when the discount is applied. * **percentage**: Applies a percentage discount of value. For example, if value is -30, then 30% will be deducted when the discount is applied. If target_type is shipping_line, then only percentage is accepted.

## Response `200`

OK

- PriceRuleSwaggerResponse
  - `price_rule` PriceRuleDto
    - `allocation_limit` integer
    - `allocation_method` string — The allocation method of the price rule. Valid values: * **each**: The discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15. * **across**: The calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items. When the value of `target_type` is `shipping_line`, then this value must be `each`.
    - `created_at` string — The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the price rule was created.
    - `customer_selection` string — The customer selection for the price rule. Valid values: * **all**: The price rule is valid for all customers. * **prerequisite**: The customer must either belong to one of the customer saved searches specified by `prerequisite_saved_search_ids` , or be one of the customers specified by ```prerequisite_customer_ids```.
    - `ends_at` string — The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the price rule ends. Must be after starts_at.
    - `entitled_collection_ids` integer[] — A list of IDs of collections whose products will be eligible to the discount. It can be used only with target_type set to line_item and target_selection set to entitled. It can't be used in combination with entitled_product_ids or entitled_variant_ids.
    - `entitled_country_ids` integer[] — A list of IDs of shipping countries that will be entitled to the discount. It can be used only with target_type set to shipping_line and target_selection set to entitled.
    - `entitled_product_ids` integer[] — A list of IDs of products that will be entitled to the discount. It can be used only with `target_type` set to `line_item` and `target_selection` set to `entitled`. ``` If a product variant is included in entitled_variant_ids, then entitled_product_ids can't include the ID of the product associated with that variant.```
    - `entitled_variant_ids` integer[] — A list of IDs of product variants that will be entitled to the discount. It can be used only with target_type set to line_item and target_selection set to entitled.
    - `id` integer — The ID for the price rule.
    - `maximum_discount_amount` number — maximum discount use
    - `once_per_customer` boolean — Whether the generated discount code will be valid only for a single use per customer. This is tracked using customer ID.
    - `prerequisite_collection_ids` integer[] — List of collection ids that will be a prerequisites for a Buy X Get Y discount. The entitled_collection_ids can be used only with: * target_type set to line_item, * target_selection set to entitled, * allocation_method set to each and * prerequisite_to_entitlement_quantity_ratio defined. Cannot be used in combination with prerequisite_product_ids or prerequisite_variant_ids.
    - `prerequisite_customer_ids` integer[] — List of variant ids that will be a prerequisites for a Buy X Get Y type discount. The entitled_variant_ids can be used only with: * target_type set to line_item, * target_selection set to entitled, * allocation_method set to each and * prerequisite_to_entitlement_quantity_ratio defined.
    - `prerequisite_emails` string[] — List of emails that will be a prerequisite for a discount
    - `prerequisite_product_ids` integer[] — List of product ids that will be a prerequisites for a Buy X Get Y type discount. The prerequisite_product_ids can be used only with: * target_type set to line_item, * target_selection set to entitled, * allocation_method set to each and * prerequisite_to_entitlement_quantity_ratio defined.
    - `prerequisite_quantity_range` QuantityRange
      - `greater_than_or_equal_to` number
    - `prerequisite_shipping_price_range` ShippingPriceRange
      - `less_than_or_equal_to` number
    - `prerequisite_subtotal_range` SubtotalRange
      - `greater_than_or_equal_to` number
    - `prerequisite_to_entitlement_quantity_ratio` ToEntitlementQuantityRatio
      - `entitled_quantity` number
      - `prerequisite_quantity` number
    - `prerequisite_variant_ids` integer[] — List of variant ids that will be a prerequisites for a Buy X Get Y type discount. The entitled_variant_ids can be used only with: * target_type set to line_item, * target_selection set to entitled, * allocation_method set to each and * prerequisite_to_entitlement_quantity_ratio defined.
    - `quota_per_customer` integer — Limit use a customer
    - `quota_per_store` integer — Limit use a store
    - `shop_id` integer
    - `starts_at` string — The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the price rule starts.
    - `status` string
    - `target_selection` string — The target selection method of the price rule. Valid values: * **all**: The price rule applies the discount to all line items in the checkout. * **entitled**: The price rule applies the discount to selected entitlements only.
    - `target_type` string — The target type that the price rule applies to. Valid values: * **line_item**: The price rule applies to the cart's line items. * **shipping_line**: The price rule applies to the cart's shipping lines.
    - `title` string — The title of the price rule. This is used by the ShopBase admin search to retrieve discounts. It is also displayed on the **Discounts** page of the ShopBase admin for bulk discounts. For non-bulk discounts, the discount code is displayed on the admin. For a consistent search experience, use the same value for title as the code property of the associated discount code.
    - `total_redemption` integer — Total amount used discount
    - `total_sale_count` number — Total discount sale count
    - `type` string
    - `updated_at` string — The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the price rule was updated.
    - `usage_count` integer
    - `usage_limit` integer — The maximum number of times the price rule can be used, per discount code.
    - `value` number — The value of the price rule. If if the value of target_type is shipping_line, then only -100 is accepted. The value must be negative.
    - `value_type` string — The value type of the price rule. Valid values: * **fixed_amount**: Applies a discount of value as a unit of the store's currency. For example, if value is -30 and the store's currency is USD, then $30 USD is deducted when the discount is applied. * **percentage**: Applies a percentage discount of value. For example, if value is -30, then 30% will be deducted when the discount is applied. If target_type is shipping_line, then only percentage is accepted.

---

[API](https://skmtc.net/shopbase/apis/shopbase-internal-api.md) · [All operations](https://skmtc.net/shopbase/apis/shopbase-internal-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/shopbase/shopbase-internal-api/revisions/353ccde6240d/schema)
