Update deal
Tags: #hubspot #crm #sales #deal #naas_drivers
Author: Florent Ravenel

Input

Import library

1
from naas_drivers import hubspot
Copied!

Setup your HubSpot

👉 Access your HubSpot API key
1
HS_API_KEY = 'YOUR_HUBSPOT_API_KEY'
Copied!

Enter deal parameters to update

1
deal_id = "3501002068"
2
dealname = "TEST"
3
dealstage = '5102584'
4
closedate = '2021-12-31' #date format must be %Y-%m-%d
5
amount = '100.50'
6
hubspot_owner_id = None
Copied!

Model

With patch method

1
update_deal = {"properties":
2
{
3
"dealstage": dealstage,
4
"dealname": dealname,
5
"amount": amount,
6
"closedate": closedate,
7
"hubspot_owner_id": hubspot_owner_id,
8
}
9
}
10
11
deal1 = hubspot.connect(HS_API_KEY).deals.patch(deal_id,
12
update_deal)
Copied!

With update method

1
deal2 = hubspot.connect(HS_API_KEY).deals.update(
2
deal_id,
3
dealname,
4
dealstage,
5
closedate,
6
amount,
7
hubspot_owner_id
8
)
Copied!

Output

Display results

1
deal1
Copied!
1
deal2
Copied!
Copy link
Edit on GitHub