Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I create a product? #11

Open
TomasArruda opened this issue Jan 28, 2020 · 0 comments
Open

How can I create a product? #11

TomasArruda opened this issue Jan 28, 2020 · 0 comments

Comments

@TomasArruda
Copy link

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:

#<Hashie::Mash additional_data=nil data=nil error="Price attribute must be set for each price." error_info="Acesse developers.pipedrive.com para mais informações sobre a API do Pipedrive." failed=false not_authorized=false success=false>

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?

@TomasArruda TomasArruda changed the title How can I create product? How can I create a product? Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant