Bug report: unable to edit Price Rule because of invalid "target_selection" state

 

Request:

PUT /price_rules/621938835525.json

body: {price_rule: {ends_at: null}}

shop ID: 9483845679

 

Response:

status: 422

x-request-id: 662e73cc-43fe-4abf-82d4-fd69e0a1c18f

x-shopify-api-version: 2021-01

body: {"base": ["item_entitlements: a minimum of one entitlement must be provided if target_selection is entitled"]}

 

----

 

As suggested by the error, target_selection=entitled for this Price Rule, but no entitlements are provided. I was not able to reproduce this state using merchant admin UI. Perhaps the Price Rule reached this state after some entitlement IDs became obsolete as a result of product deletion? I did not test this, just a hypothesis. Regardless I would consider this a bug as Shopify returns the Price Rule in an invalid state. 

Founder and tech lead for Simple Affiliate:
https://apps.shopify.com/simple-affiliate