Bad Request to add installment payment using API


For some reason I’m receiving a “Bad Request” error 400 when trying to create a new payment installment using the API.

I suspect the “payments” array Object I’m passing in the API is wrongly formatted, but couldn’t find any good example to pass arrays using POST on Pipedrive.

I’m using Python, my code:

    url = ""

    payload = {
        "deal_id": 123,
        "currency": "USD",
        "payments": [{"amount":"123", "description":"test", "due_at":"2022-05-26"}]
    r =, data=payload)

Also got a Bad Request testing on Postman:

Any ideas?

I found a solution, the json body must be encoded with json.dumps:

  url = ""

  payload = json.dumps({
      "deal_id": deal_id,
      "currency": "USD",
      "payments": [
          {"amount": "123", "description":"test", "due_at":"2022-05-26"}
      "update_deal_value": False
  r =, data=payload, headers={'accept': 'application/json','content-type':'application/json'})