Skip to main content
Update an existing estimate with new details
PUT https://services.leadconnectorhq.com/invoices/estimate/{estimateId}

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

estimateId
string
default:"5f9d6d8b1b2d2c001f2d9e4b"
required
Estimate Id

Body

altId
string
default:"6578278e879ad2646715ba9c"
required
Account Id or Agency Id
altType
string
required
Posibles valores: ‘account’
name
string
default:"Home Service Estimate"
required
Estimate Name
businessDetails
object
required
currency
string
default:"USD"
required
Currency code
items
object[]
required
An array of items for the estimate.
liveMode
boolean
default:"True"
livemode for estimate
discount
object
required
termsNotes
string
default:"<p>This is a default terms.</p>"
Terms notes, Also supports HTML markups
title
string
default:"ESTIMATE"
Title for the estimate
contactDetails
object
required
Contact information to send the estimate to
estimateNumber
number
default:"1001"
Estimate Number, if not specified will take in the next valid estimate number
issueDate
string
default:"2024-08-07"
issue date estimate
expiryDate
string
default:"2024-08-10"
expiry date estimate
sentTo
object
Email and sent to details for the estimate
automaticTaxesEnabled
boolean
default:"True"
Automatic taxes enabled for the Estimate
meta
object
Meta data for the estimate
sendEstimateDetails
object
When sending estimate directly while saving
frequencySettings
object
required
frequency settings for the estimate
estimateNumberPrefix
string
default:"EST-"
Prefix for the estimate number
userId
string
default:"6578278e879ad2646715ba9c"
User Id
attachments
object[]
attachments for the invoice
autoInvoice
object
Auto invoice for the estimate
miscellaneousCharges
object
miscellaneous charges for the estimate
paymentScheduleConfig
object
Payment Schedule Config for the estimate
estimateStatus
string
default:"sent"
Estimate Status Posibles valores: ‘all’, ‘draft’, ‘sent’, ‘accepted’, ‘declined’, ‘invoiced’, ‘viewed’

Respuestas

altId
string
default:"6578278e879ad2646715ba9c"
required
Account Id or Agency Id
altType
string
required
Posibles valores: ‘account’
_id
string
default:"67ac9a51106ee8311e911XXXX"
required
Unique identifier
liveMode
boolean
default:"True"
required
Indicates if it is in live mode
deleted
boolean
default:"False"
required
Indicates if deleted
name
string
default:"Estimate Name"
required
Name
currency
string
default:"USD"
required
Currency code
businessDetails
object
required
Business details associated with the estimate
items
array[]
required
An array of items
discount
object
required
Discount details for the estimate template
title
string
default:"ESTIMATE"
Title
estimateNumberPrefix
string
default:"EST-"
Estimate number prefix
attachments
object[]
Attachments
updatedBy
string
default:"3HIpOF9NIc5ltriQXXXX"
User Id of who last updated
total
number
default:"1222.03"
required
Total amount
createdAt
string
default:"2025-02-12T13:17:47.416Z"
required
Timestamp when created
updatedAt
string
default:"2025-02-12T13:17:47.416Z"
required
Timestamp when last updated
__v
number
default:"0"
required
Version number
automaticTaxesEnabled
boolean
default:"False"
required
Indicates if automatic taxes are enabled for this estimate
termsNotes
string
Terms and conditions for the estimate, supports HTML markup
companyId
string
default:"COMP12345"
required
Company identifier associated with the estimate
contactDetails
object
required
Contact details for the estimate
issueDate
string
default:"2023-06-15T00:00:00.000Z"
required
Date when the estimate was issued
expiryDate
string
default:"2023-07-15T00:00:00.000Z"
required
Date when the estimate expires
sentBy
string
default:"user@example.com"
User who sent the estimate
automaticTaxesCalculated
boolean
default:"True"
required
Indicates if automatic taxes were calculated
meta
object
required
Additional metadata associated with the estimate
estimateActionHistory
string[]
required
History of actions taken on the estimate
sentTo
object
required
Recipient details for the estimate
frequencySettings
object
required
Frequency settings for recurring estimates
lastVisitedAt
string
default:"2023-06-20T08:30:00.000Z"
required
Timestamp when the estimate was last visited
totalamountInUSD
number
default:"1500.75"
required
Total amount in USD
autoInvoice
object
Auto-invoice settings for the estimate
traceId
string
default:"010c7a01-857f-4619-970d-xyxyxyxy"
required
Trace ID for logging and debugging
{
  "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
}
{}
{}
{}

Ejemplo

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);