I was able to achieve this very easily using Make.com
However when I tried to code, I realized that there is no explanation or examples in the documentation. I’m very confused.
I looked at these resources:
Official doc on Add Product for v1 and v2
Adding a Product tutorial
Postman example
https://www.postman.com/pipedrive-developers/pipedrive-api-collection/request/txo43yd/add-a-product
I was able to create a basic one in Python like this, but how can I add the custom fields?
One thing I do understand is that I might have to map my custom fields name in Japanese to English, but where is the documentation that explains this process?
import requests
import json
url = "https://api.pipedrive.com/api/v2/products"
payload = json.dumps({
"name": "Sample Product",
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
# Add the API token as a query parameter
params = {
"api_token": pipedrive_api_token
}
response = requests.request("POST", url, params=params, headers=headers, data=payload)
print(response.text)