[customer_saved_search] => Required parameter missing or invalid - priceRule api

danielmed
Tourist
3 0 1

Hello fellow developers,

I'm trying to create a shopify app, and am trying to create price rules for it.

I managed to create saved_search_id's without a problem,
When i however try to create a price rule for that saved_search_id, it gives me error.

 

 

            [customer_saved_search] => Required parameter missing or invalid

 

When i however try to call that specific saved_search, i get the following message (success).

stdClass Object ( [customer_saved_search] => stdClass Object ( [id] => 1781938880665 [name] => Wholesalos: 5f80ea7c47828 [created_at] => 2020-10-09T18:55:55-04:00 [updated_at] => 2020-10-09T18:55:55-04:00 [query] => tag:Wholesaler3 ) )

So by my understanding, it should work with the call i make below.
But for some reason it dont.


 Here is my call array, i'm not sure what i'm doing wrong.

 

(
    [price_rule] => Array
        (
            [title] => WHOLESALOS36524635947161
            [target_type] => line_item
            [target_selection] => entitled
            [allocation_method] => each
            [value_type] => fixed_amount
            [value] => -2
            [customer_selection] => prerequisite
            [prerequisite_saved_search_ids] => Array
                (
                    [0] => 1781938880665
                )

            [entitled_variant_ids] => Array
                (
                    [0] => 36524635947161
                )

        )
)

 

 

 Here is the call array json formatted.

 

 

"price_rule":{
      "title":"WHOLESALOS36524635947161",
      "target_type":"line_item",
      "target_selection":"entitled",
      "allocation_method":"each",
      "value_type":"fixed_amount",
      "value":-2,
      "customer_selection":"prerequisite",
      "prerequisite_saved_search_ids":[
         1781938946201
      ],
      "entitled_variant_ids":[
         36524635947161
      ]
   }

 



Would appreciate all the help i could get.

best regards Daniel.

 

danielmed
Tourist
3 0 1

Any one?

0 Likes
danielmed
Tourist
3 0 1

I have found the issue, i put in the wrong url.

0 Likes