Error In API cURL Call: {"errors":{"price_rule":"Required parameter missing or invalid"}}

Highlighted
Shopify Partner
19 1 3

I am getting an error in cURL call for Price rule based on selected products.
Following is my error:

{"errors":{"price_rule":"Required parameter missing or invalid"}}

Following is my body parameters which I am sending in cURL call:

{"price_rule":{"title":"sss","target_type":"line_item","target_selection":"entitled","allocation_method":"across","value_type":"fixed_amount","value":"-434","customer_selection":"all","prerequisite_quantity_range":{"greater_than_or_equal_to":"2"},"entitled_product_ids":{"0":"2397130326093","1":"2397129965645","2":"2397131898957","3":"2397132324941"},"starts_at":"2019-02-22T08:08:53.000Z"}}

Please note that I am working in PHP.
Thanks in Advance! 

0 Likes
Shopify Partner
1166 134 206

Make sure you send Content-Type header to application/json when making the request.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
1 Like
Shopify Partner
19 1 3

Thanks for your reply,
it was too late to give a solution , I have made is working by myself and one of my stack overflow friend. it is working very fine now,, the issue was in cURL, I have add some headers, and made changes in parameters. 

0 Likes