I am having trouble creating a quote. A lot of the information I pass is not being inserted into the entity. This is the code quote_url = “https://api.hubapi.com/crm/v3/objects/quotes”
quote_payload = {
“properties”: {
“hs_title”: f"Contratto per {customer_name}",
“hs_expiration_date”: expiration_date_timestamp,
“hs_esign_enabled”: “true”,
“hs_status”: “DRAFT”, # Imposta la Quote come “PUBLISHED” per inviare l’email
“hs_language”: “it”, # Imposta la lingua della Quote su Italiano
“hs_template_type”: “QUOTE”, # Usa un template valido di HubSpot
“hubspot_owner_id”: “169999874268”,
}
}
quote_response = requests.post(quote_url, json=quote_payload, headers=headers)
# Verificare la risposta della creazione della Quote
if quote_response.status_code != 201:
return {
“statusCode”: quote_response.status_code,
“body”: json.dumps(
{
“success”: False,
“message”: “Errore nella creazione della Quote”,
“details”: quote_response.text,
}
),
}
# Ottenere l’ID della Quote appena creata
quote_id = quote_response.json()[“id”]
#
5. Associare la Quote al Deal
quote_association_url = (
“https://api.hubapi.com/crm/v3/associations/Deals/Quotes/batch/create”
)
quote_association_payload = {
“inputs”: [
{
“from”: {“id”: deal_id},
“to”: {“id”: quote_id},
“type”: “deal_to_quote”,
}
]
}
quote_association_response = requests.post(
quote_association_url, json=quote_association_payload, headers=headers
)
association_url = (
“https://api.hubapi.com/crm/v3/associations/Quotes/Line_Items/batch/create”
)
association_payload = {
“inputs”: [
{
“from”: {“id”: quote_id},
“to”: {“id”: “109266461927”},
“type”: “quote_to_line_item”,
}
]
}
association_response = requests.post(
association_url, json=association_payload, headers=headers
)
these are the pages that appear after the quote has been created



