API break on addProduct to deals

Our API integration with Pipedrive has worked perfectly for the last year, but we recently realized in the last 2 weeks, that our code that adds products to a deal are now returning errors.

Our investigation in other threads that there was a code push at the end of March that caused other issues with the API.

Our code is in PHP using the composer library. Here is an example.

try {
$pipedrive = new Pipedrive($this->token);
$itemResponse = $pipedrive->deals()->addProduct($id,$product_id, $item_price, $quantity, $options);
} catch (Exception $e) {
return false;
}

The error exception we are getting is “body/product_id must be integer, body/item_price must be number, body/quantity must be number”.

Using the debugger tools we can confirm that product_id is an integer and the item_price and quantity are both numbers. No strings.

Hello, @mbastarache and welcome to the community! :wave:

I have DM’d you for more information, so our team can investigate this!

Looking forward to hearing from you,
Helena

1 Like

Hey guys,

We have also been having trouble with this endpoint, we used to send the products in a Array , now this endpoint only accepts one product, which changes the endpoint.

I have looked over the changelog and haven’t seen any mention of it can you guys confirm it?

1 Like

Hello, @Gabriel_Ramos and @snthaoeusntahoeu! :wave:

I have DM’d you both for additional details, so we can look into it and figure out how to best support you here. :slight_smile:

We have increased the validation of this endpoint, so the request payload behavior matches the reality that has been documented in our API Reference. We are working on explaining all the details via Changelog, too.

Sincerely,
Helena

1 Like