Problem when create a Quote

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”]
# :small_blue_diamond: 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

Hey @IAlbanese :waving_hand: Thanks for providing your code example and screenshots. Have you tried doing this in one call instead of making calls to multiple endpoints?

If it were me, I’d take the example provided here for creating a quote with associations in a single request, adapt it to your specific details — template ID, object IDs, and item IDs for your associations. Then jump over to Postman to see if you can get it working outside your code. That should yield some good feedback on what you might need to adjust in your code.

Have fun testing! — Jaycee