Update an existing estimate with new details
PUT https://services.leadconnectorhq.com/invoices/estimate/{estimateId}Authorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
estimateId | string | Yes | 5f9d6d8b1b2d2c001f2d9e4b | Estimate Id |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | Yes | 6578278e879ad2646715ba9c | Account Id or Agency Id |
altType | string | Yes | Possible values: 'account' | |
name | string | Yes | Home Service Estimate | Estimate Name |
businessDetails(object, required)logoUrl(string): Business Logo URL Example:https://example.com/logo.pngname(string): Business Name Example:ABC Corp.phoneNo(string): Business Phone Number Example:+1-214-559-6993address(object): Business Address Example:9931 Beechwood, TXwebsite(string): Business Website Link Example:wwww.example.comcustomValues(string[]): Custom Values
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
currency | string | Yes | USD | Currency code |
items(object[], required): An array of items for the estimate.name(string, required): Invoice Item Name Example:ABC Productdescription(string): Invoice descriptions Example:ABC Corp.productId(string): Product Id Example:6578278e879ad2646715ba9cpriceId(string): Price Id Example:6578278e879ad2646715ba9ccurrency(string, required): Currency Example:USDamount(number, required): Product amount Example:999qty(number, required): Product Quantity Example:1taxes(object[]): Tax_id(string, required)name(string, required)rate(number, required)calculation(string): Possible values: 'exclusive'description(string)taxId(string)
automaticTaxCategoryId(string): Tax category id for calculating automatic tax Example:6578278e879ad2646715ba9cisSetupFeeItem(boolean): Setupfee item, only created when 1st invoice of recurring schedule is generatedtype(string): Price type of the item Possible values: 'one_time', 'recurring' Example:one_timetaxInclusive(boolean): true if item amount is tax inclusive Example:Trueattachments(string[]): Attachments for the line item
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
liveMode | boolean | No | True | livemode for estimate |
discount(object, required)value(number): Discount Value Example:10type(string, required): Discount type Possible values: 'percentage', 'fixed' Example:percentagevalidOnProductIds(string[]): Product Ids on which discount is applicable Example:[ '6579751d56f60276e5bd4154' ]
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
termsNotes | string | No | <p>This is a default terms.</p> | Terms notes, Also supports HTML markups |
title | string | No | ESTIMATE | Title for the estimate |
contactDetails | object | Yes | Contact information to send the estimate to | |
estimateNumber | number | No | 1001 | Estimate Number, if not specified will take in the next valid estimate number |
issueDate | string | No | 2024-08-07 | issue date estimate |
expiryDate | string | No | 2024-08-10 | expiry date estimate |
sentTo | object | No | Email and sent to details for the estimate | |
automaticTaxesEnabled | boolean | No | True | Automatic taxes enabled for the Estimate |
meta | object | No | Meta data for the estimate | |
sendEstimateDetails | object | No | When sending estimate directly while saving | |
frequencySettings | object | Yes | frequency settings for the estimate | |
estimateNumberPrefix | string | No | EST- | Prefix for the estimate number |
userId | string | No | 6578278e879ad2646715ba9c | User Id |
attachments(object[]): attachments for the invoiceid(string, required): Id of the file selected Example:6241712be68f7a98102ba272name(string, required): Name of the file Example:Electronics.pdfurl(string, required): URL of the file Example:https://example.com/digital-deliverytype(string, required): Type of the filesize(number, required): Size of the file Example:10000
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
autoInvoice | object | No | Auto invoice for the estimate | |
miscellaneousCharges | object | No | miscellaneous charges for the estimate | |
paymentScheduleConfig | object | No | Payment Schedule Config for the estimate | |
estimateStatus | string | No | sent | Estimate Status Possible values: 'all', 'draft', 'sent', 'accepted', 'declined', 'invoiced', 'viewed' |
Responses
200 - Successfully updated
altId(string, required): Account Id or Agency Id Example:6578278e879ad2646715ba9caltType(string, required): Possible values: 'account'_id(string, required): Unique identifier Example:67ac9a51106ee8311e911XXXXliveMode(boolean, required): Indicates if it is in live mode Example:Truedeleted(boolean, required): Indicates if deleted Example:Falsename(string, required): Name Example:Estimate Namecurrency(string, required): Currency code Example:USDbusinessDetails(object, required): Business details associated with the estimateitems(array[], required): An array of itemsdiscount(object, required): Discount details for the estimate templatetitle(string): Title Example:ESTIMATEestimateNumberPrefix(string): Estimate number prefix Example:EST-attachments(object[]): Attachmentsid(string, required): Id of the file selected Example:6241712be68f7a98102ba272name(string, required): Name of the file Example:Electronics.pdfurl(string, required): URL of the file Example:https://example.com/digital-deliverytype(string, required): Type of the filesize(number, required): Size of the file Example:10000
updatedBy(string): User Id of who last updated Example:3HIpOF9NIc5ltriQXXXXtotal(number, required): Total amount Example:1222.03createdAt(string, required): Timestamp when created Example:2025-02-12T13:17:47.416ZupdatedAt(string, required): Timestamp when last updated Example:2025-02-12T13:17:47.416Z__v(number, required): Version number Example:0automaticTaxesEnabled(boolean, required): Indicates if automatic taxes are enabled for this estimate Example:FalsetermsNotes(string): Terms and conditions for the estimate, supports HTML markup Example:<p>All services are subject to availability.</p>companyId(string, required): Company identifier associated with the estimate Example:COMP12345contactDetails(object, required): Contact details for the estimateissueDate(string, required): Date when the estimate was issued Example:2023-06-15T00:00:00.000ZexpiryDate(string, required): Date when the estimate expires Example:2023-07-15T00:00:00.000ZsentBy(string): User who sent the estimate Example:user@example.comautomaticTaxesCalculated(boolean, required): Indicates if automatic taxes were calculated Example:Truemeta(object, required): Additional metadata associated with the estimateestimateActionHistory(string[], required): History of actions taken on the estimatesentTo(object, required): Recipient details for the estimatefrequencySettings(object, required): Frequency settings for recurring estimateslastVisitedAt(string, required): Timestamp when the estimate was last visited Example:2023-06-20T08:30:00.000ZtotalamountInUSD(number, required): Total amount in USD Example:1500.75autoInvoice(object): Auto-invoice settings for the estimatetraceId(string, required): Trace ID for logging and debugging Example:010c7a01-857f-4619-970d-xyxyxyxy
{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"_id": "67ac9a51106ee8311e911XXXX",
"liveMode": true,
"deleted": false,
"name": "Estimate Name",
"currency": "USD",
"businessDetails": {
"logoUrl": "your_image-url",
"name": "Business name",
"address": {
"addressLine1": "address line 1",
"city": "Test City",
"state": "State Name",
"countryCode": "US",
"postalCode": "12345"
},
"phoneNo": "+1 1234567890",
"website": "www.example.com",
"customValues": [
{
"name": "Test",
"fieldKey": "{{custom_values.test}}",
"id": "5DYTWoiQvWiIJZXX44XXX",
"value": "Test's Custom Value"
}
]
},
"items": [
{
"taxes": [],
"taxInclusive": false,
"_id": "67ac9a51106ee8311e911XXXX",
"description": "<p>Futuristic anti-gravity racing</p>",
"currency": "USD",
"productId": "67ac9a51106ee8311e911XXXX",
"priceId": "67ac9a51106ee8311e911XXXX",
"amount": 9.99,
// truncado: 86 lineas mas
}400 - Bad Request
{}422 - Unprocessable Entity
{}Example
curl -X PUT 'https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"name": "Home Service Estimate",
"businessDetails": {
"logoUrl": "https://example.com/logo.png",
"name": "ABC Corp.",
"phoneNo": "+1-214-559-6993",
"address": "9931 Beechwood, TX",
"website": "wwww.example.com",
"customValues": [
"string"
]
},
"currency": "USD",
"items": [
{
"name": "ABC Product",
"description": "ABC Corp.",
"productId": "6578278e879ad2646715ba9c",
"priceId": "6578278e879ad2646715ba9c",
"currency": "USD",
"amount": 999,
"qty": 1,
"taxes": [
{}
],
"automaticTaxCategoryId": "6578278e879ad2646715ba9c",
"isSetupFeeItem": true,
"type": "one_time",
"taxInclusive": true,
"attachments": [
"https://example.com/file1.jpg",
"https://example.com/file2.png"
]
}
],
"liveMode": true,
"discount": {
"value": 10,
"type": "percentage",
"validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"
},
"termsNotes": "<p>This is a default terms.</p>",
"title": "ESTIMATE",
"estimateNumber": 1001,
"issueDate": "2024-08-07",
"expiryDate": "2024-08-10",
"automaticTaxesEnabled": true,
"meta": {
"key": "value"
},
"estimateNumberPrefix": "EST-",
"userId": "6578278e879ad2646715ba9c",
"attachments": [
{
"id": "6241712be68f7a98102ba272",
"name": "Electronics.pdf",
"url": "https://example.com/digital-delivery",
"type": "string",
"size": 10000
}
],
"autoInvoice": {
"enabled": true,
"directPayments": true
},
"estimateStatus": "sent"
}'const response = await fetch('https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "name": "Home Service Estimate", "businessDetails": {"logoUrl": "https://example.com/logo.png", "name": "ABC Corp.", "phoneNo": "+1-214-559-6993", "address": "9931 Beechwood, TX", "website": "wwww.example.com", "customValues": ["string"]}, "currency": "USD", "items": [{"name": "ABC Product", "description": "ABC Corp.", "productId": "6578278e879ad2646715ba9c", "priceId": "6578278e879ad2646715ba9c", "currency": "USD", "amount": 999, "qty": 1, "taxes": [{}], "automaticTaxCategoryId": "6578278e879ad2646715ba9c", "isSetupFeeItem": true, "type": "one_time", "taxInclusive": true, "attachments": ["https://example.com/file1.jpg", "https://example.com/file2.png"]}], "liveMode": true, "discount": {"value": 10, "type": "percentage", "validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"}, "termsNotes": "<p>This is a default terms.</p>", "title": "ESTIMATE", "estimateNumber": 1001, "issueDate": "2024-08-07", "expiryDate": "2024-08-10", "automaticTaxesEnabled": true, "meta": {"key": "value"}, "estimateNumberPrefix": "EST-", "userId": "6578278e879ad2646715ba9c", "attachments": [{"id": "6241712be68f7a98102ba272", "name": "Electronics.pdf", "url": "https://example.com/digital-delivery", "type": "string", "size": 10000}], "autoInvoice": {"enabled": true, "directPayments": true}, "estimateStatus": "sent"}),
});
const data = await response.json();import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "name": "Home Service Estimate", "businessDetails": {"logoUrl": "https://example.com/logo.png", "name": "ABC Corp.", "phoneNo": "+1-214-559-6993", "address": "9931 Beechwood, TX", "website": "wwww.example.com", "customValues": ["string"]}, "currency": "USD", "items": [{"name": "ABC Product", "description": "ABC Corp.", "productId": "6578278e879ad2646715ba9c", "priceId": "6578278e879ad2646715ba9c", "currency": "USD", "amount": 999, "qty": 1, "taxes": [{}], "automaticTaxCategoryId": "6578278e879ad2646715ba9c", "isSetupFeeItem": true, "type": "one_time", "taxInclusive": true, "attachments": ["https://example.com/file1.jpg", "https://example.com/file2.png"]}], "liveMode": true, "discount": {"value": 10, "type": "percentage", "validOnProductIds": "[ '6579751d56f60276e5bd4154' ]"}, "termsNotes": "<p>This is a default terms.</p>", "title": "ESTIMATE", "estimateNumber": 1001, "issueDate": "2024-08-07", "expiryDate": "2024-08-10", "automaticTaxesEnabled": true, "meta": {"key": "value"}, "estimateNumberPrefix": "EST-", "userId": "6578278e879ad2646715ba9c", "attachments": [{"id": "6241712be68f7a98102ba272", "name": "Electronics.pdf", "url": "https://example.com/digital-delivery", "type": "string", "size": 10000}], "autoInvoice": {"enabled": true, "directPayments": true}, "estimateStatus": "sent"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'name': 'Home Service Estimate', 'businessDetails': {'logoUrl': 'https://example.com/logo.png', 'name': 'ABC Corp.', 'phoneNo': '+1-214-559-6993', 'address': '9931 Beechwood, TX', 'website': 'wwww.example.com', 'customValues': ['string']}, 'currency': 'USD', 'items': [{'name': 'ABC Product', 'description': 'ABC Corp.', 'productId': '6578278e879ad2646715ba9c', 'priceId': '6578278e879ad2646715ba9c', 'currency': 'USD', 'amount': 999, 'qty': 1, 'taxes': [{}], 'automaticTaxCategoryId': '6578278e879ad2646715ba9c', 'isSetupFeeItem': true, 'type': 'one_time', 'taxInclusive': true, 'attachments': ['https://example.com/file1.jpg', 'https://example.com/file2.png']}], 'liveMode': true, 'discount': {'value': 10, 'type': 'percentage', 'validOnProductIds': '[ '6579751d56f60276e5bd4154' ]'}, 'termsNotes': '<p>This is a default terms.</p>', 'title': 'ESTIMATE', 'estimateNumber': 1001, 'issueDate': '2024-08-07', 'expiryDate': '2024-08-10', 'automaticTaxesEnabled': true, 'meta': {'key': 'value'}, 'estimateNumberPrefix': 'EST-', 'userId': '6578278e879ad2646715ba9c', 'attachments': [{'id': '6241712be68f7a98102ba272', 'name': 'Electronics.pdf', 'url': 'https://example.com/digital-delivery', 'type': 'string', 'size': 10000}], 'autoInvoice': {'enabled': true, 'directPayments': true}, 'estimateStatus': 'sent'}),
]);
$data = json_decode(curl_exec($ch), true);