Hello. I’m having issues adding products to a deal. The below code was working until the last update (March 29). Now, I get an error:
‘product_id’ must be integer, ‘item_price’ must be number, ‘quantity’ must be number, ‘discount_percentage’ must match a schema in anyOf
#PHP CODE for Adding Product to Deal
$prod_id = 23;
$prod_price = 332.12;
$s_discount = 0.15;
$data = array(
'product_id' => (int)$prod_id,
'item_price' => (float)$prod_price,
'quantity' => 1,
'discount_percentage' => (float)$s_discount,
);
// URL for updating a Deal
$url = 'https://'.$company.'.pipedrive.com/v1/deals/441/products?api_token=' . $api_token;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);
curl_close($ch);