amoniacou / pipedrive.rb

Pipedrive.com API Wrapper
MIT License
33 stars 56 forks source link

How can I create a product? #11

Open TomasArruda opened 4 years ago

TomasArruda commented 4 years ago

Hello,

I am having some problems to create Product, I don't know what kind of parameters I should send to the creations endpoint. I managed to create a Product without the prices attribute, but once I added it fails.

Here is the request I am making:

Pipedrive::Product.new.create( { name: "test", code: "test", prices: [ { price: 1, currency: "EUR" } ] } )

And I am get this as a response:

`

`

I checked the Pipedrive documentation and saw that the add product endpoint expects the following JSON: { "name": "", "code": "", "unit": "", "tax": "", "active_flag": "", "visible_to": "", "owner_id": "", "prices":[ { "price": "", "currency": "", "cost": "", "overhead_cost": "" } ] }

In summary, how can I use this gem to add a product with prices?