copilot_frontend
copilot_order
Save Budget
Saves a complete order (pedido) to database and creates/updates contact in HubSpot.
This endpoint:
- Gets province name from database
- Updates commercial phone if provided and different from current
- Gets "pedido" status from database to use as estado_id
- Creates/updates contact in HubSpot with client data
- Updates contact with all order properties (payment, installation, subsidies, etc.)
- Updates deal property "pedido_de_venta_backend" = "Si"
- Saves order in presup_presupuestos table with estado="pedido" and all order data
🔒 Protected Endpoint: Requires JWT authentication and 'ui_comercial' or 'admin' role
Args: request: SaveOrderRequest with client data, calculation data (already calculated from Vue), selected option, and complete order data (payment, installation, subsidies, etc.) current_user: Current authenticated user
Returns: SaveBudgetResponse with success status, order ID, and HubSpot contact ID
Raises: ErrValidation: If user does not have comercial_id ErrNotFound: If province or "pedido" status not found Exception: If HubSpot or database save fails
post/api/order/save
Request body
Response
Successful Response
Changes
No recorded changes to this endpoint across all 1 revision of this API.