copilot_frontend
copilot_budget
Save Budget
Saves a complete budget to database and creates/updates contact in HubSpot.
This endpoint:
- Gets province name from database
- Updates commercial phone if provided and different from current
- Recalculates the budget using BudgetCalculatorService
- Creates/updates contact in HubSpot with client data
- Creates note in HubSpot deal with selected option details
- Saves budget in presup_presupuestos table
- Generates tokenized URL and updates HubSpot deal property
Protected Endpoint: Requires JWT authentication and 'ui_comercial' or 'admin' role
Args: request: SaveBudgetRequest with client data, calculation parameters, selected option, and optional commercial phone current_user: Current authenticated user db: Database session
Returns: SaveBudgetResponse with success status, budget ID, and HubSpot contact ID
Raises: ErrValidation: If user does not have comercial_id ErrNotFound: If province not found Exception: If HubSpot or database save fails
post/api/budget/save
Request body
Response
Successful Response
Changes
No recorded changes to this endpoint across all 1 revision of this API.