Post - "prices":[{"price":123, "currency":"USD"}] wrong?

Hi guys,

Im work in a integration with nuvemshop.com and a try to create products in my pipedrive. And its return 400:

def add_produto_pipe():
    url_add_product = "https://api.pipedrive.com/v1/products?api_token="MYTOKEN_HERE""

    payload_product = {
    "name": "Test_name",
    "code": "SKU_code",
    "tax": "0",
    "active_flag": "1",
    "prices":[{"price":123, "currency":"USD"}]
    }
    response = requests.post(url_add_product, payload_product)
    print(response)

add_produto_pipe()

however, when i remove the LINE: “prices":[{“price”:123, “currency”:“USD”}]” the code runs well! i’ve alredy tried “price”:123.00 - “price”:“123.00” - “price”:“123” , Does someone knows whats can be wrong?

:sunglasses:

Hey @ihardt

I’ve been trying to reproduce from my side, but can’t get the same error.
Have you tried directly on the reference page?

Hi @David!

I tried directly on the reference page! And there, its runs ok “ prices":[{“price”:123, “currency”:“USD”}]

But when I tried in my script, I’m using Python 2.7 - Perhaps, does the code has some sintaxy problem? i changed to prices":{“price”:123, “currency”:“USD”} and returns 400 too.