Skip to content

How can I create a product? #11

@TomasArruda

Description

@TomasArruda

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions