Create a quote
Create a quote for services at a location, as a draft.
POST https://cotlet.dev/api/v1/servicetrade/locations/{location_id}/quotes
write Confirm
Returns the new quote with its number and status. A draft quote is not sent to the customer; use submit_quote for that. Prices come from the contract and line items in ServiceTrade. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| location_id integer required | integer | Location where the work is done, from list_locations. |
| name string required | string | Quote name. |
| description string required | string | Description of the work to be quoted. |
| job_type string required | string | A ServiceTrade job type for the job the quote creates, such as repair, inspection_repair or replacement. |
| service_request_ids array required | array | Services the quote covers, from list_service_requests. They must belong to the location. |
| status string | string | One of draft, new. |
Request
curl -X POST https://cotlet.dev/api/v1/servicetrade/locations/5120/quotes \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Repair: fire pump controller, Harbor Point Mall","description":"Replace the failed pressure switch and retest the fire pump controller.","job_type":"repair","service_request_ids":[77302],"status":"draft"}' result = client.call("servicetrade", "create_quote", {"location_id":5120,"name":"Repair: fire pump controller, Harbor Point Mall","description":"Replace the failed pressure switch and retest the fire pump controller.","job_type":"repair","service_request_ids":[77302],"status":"draft"}) const result = await cotlet.call('servicetrade', 'create_quote', {"location_id":5120,"name":"Repair: fire pump controller, Harbor Point Mall","description":"Replace the failed pressure switch and retest the fire pump controller.","job_type":"repair","service_request_ids":[77302],"status":"draft"}); cotlet call servicetrade create_quote --data '{"location_id":5120,"name":"Repair: fire pump controller, Harbor Point Mall","description":"Replace the failed pressure switch and retest the fire pump controller.","job_type":"repair","service_request_ids":[77302],"status":"draft"}' Example response
{
"quote_id": 20418,
"ref_number": "20418",
"name": "Repair: fire pump controller, Harbor Point Mall",
"status": "draft",
"location": {
"id": 5120,
"name": "Harbor Point Mall"
},
"service_request_ids": [
77302
]
}