Add Product via API (PHP)

Hi,

we are trying to add a product via your API, but we are getting an error saying: “Prices must be given as array of objects”. Can you provide a working example how to to that in php? Maybe adding this example to your documentation (here: https://pipedrive.readme.io/docs/adding-a-product) would be useful to others as well.

Thanks,
Christian

solved i!.

For anyone having the same issue: It’s not actually an array of objects. Its an array of arrays. This worked for us:

‘prices’ => [
[
‘currency’ => ‘EUR’,
‘price’ => 99
]
]

Hi
Thank you for pointing this out.
You can add prices in array of objects but the content_type needs to be application/json. We have now improved the documentation :slight_smile: