> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Estimate

> API to send estimate by estimate id

API to send estimate by estimate id

```http theme={null}
POST https://services.leadconnectorhq.com/invoices/estimate/{estimateId}/send
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="estimateId" type="string" required default="5f9d6d8b1b2d2c001f2d9e4b">
  Estimate Id
</ParamField>

## Body

<ParamField body="altId" type="string" required default="6578278e879ad2646715ba9c">
  Account Id or Agency Id
</ParamField>

<ParamField body="altType" type="string" required>
  Posibles valores: 'account'
</ParamField>

<ParamField body="action" type="string" required>
  Posibles valores: 'sms\_and\_email', 'send\_manually', 'email', 'sms'
</ParamField>

<ParamField body="liveMode" type="boolean" required default="True">
  livemode for estimate
</ParamField>

<ParamField body="userId" type="string" required default="6578278e879ad2646715ba9c">
  Please ensure that the UserId corresponds to an authorized personnel, either by an employee ID or agency ID, to access this account. This account will serve as the primary channel for all future communications and updates.
</ParamField>

<ParamField body="sentFrom" type="object">
  sender details for invoice, valid only if invoice is not sent manually
</ParamField>

<ParamField body="estimateName" type="string" default="Estimate">
  estimate name
</ParamField>

## Respuestas

<Accordion title="201 - Created">
  <ResponseField name="altId" type="string" required default="6578278e879ad2646715ba9c">
    Account Id or Agency Id
  </ResponseField>

  <ResponseField name="altType" type="string" required>
    Posibles valores: 'account'
  </ResponseField>

  <ResponseField name="_id" type="string" required default="67ac9a51106ee8311e911XXXX">
    Unique identifier
  </ResponseField>

  <ResponseField name="liveMode" type="boolean" required default="True">
    Indicates if it is in live mode
  </ResponseField>

  <ResponseField name="deleted" type="boolean" required default="False">
    Indicates if deleted
  </ResponseField>

  <ResponseField name="name" type="string" required default="Estimate Name">
    Name
  </ResponseField>

  <ResponseField name="currency" type="string" required default="USD">
    Currency code
  </ResponseField>

  <ResponseField name="businessDetails" type="object" required>
    Business details associated with the estimate
  </ResponseField>

  <ResponseField name="items" type="array[]" required>
    An array of items
  </ResponseField>

  <ResponseField name="discount" type="object" required>
    Discount details for the estimate template
  </ResponseField>

  <ResponseField name="title" type="string" default="ESTIMATE">
    Title
  </ResponseField>

  <ResponseField name="estimateNumberPrefix" type="string" default="EST-">
    Estimate number prefix
  </ResponseField>

  <ResponseField name="attachments" type="object[]">
    Attachments

    <Expandable title="cada item">
      <ResponseField name="id" type="string" required default="6241712be68f7a98102ba272">
        Id of the file selected
      </ResponseField>

      <ResponseField name="name" type="string" required default="Electronics.pdf">
        Name of the file
      </ResponseField>

      <ResponseField name="url" type="string" required default="https://example.com/digital-delivery">
        URL of the file
      </ResponseField>

      <ResponseField name="type" type="string" required>
        Type of the file
      </ResponseField>

      <ResponseField name="size" type="number" required default="10000">
        Size of the file
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="updatedBy" type="string" default="3HIpOF9NIc5ltriQXXXX">
    User Id of who last updated
  </ResponseField>

  <ResponseField name="total" type="number" required default="1222.03">
    Total amount
  </ResponseField>

  <ResponseField name="createdAt" type="string" required default="2025-02-12T13:17:47.416Z">
    Timestamp when created
  </ResponseField>

  <ResponseField name="updatedAt" type="string" required default="2025-02-12T13:17:47.416Z">
    Timestamp when last updated
  </ResponseField>

  <ResponseField name="__v" type="number" required default="0">
    Version number
  </ResponseField>

  <ResponseField name="automaticTaxesEnabled" type="boolean" required default="False">
    Indicates if automatic taxes are enabled for this estimate
  </ResponseField>

  <ResponseField name="termsNotes" type="string" default="<p>All services are subject to availability.</p>">
    Terms and conditions for the estimate, supports HTML markup
  </ResponseField>

  <ResponseField name="companyId" type="string" required default="COMP12345">
    Company identifier associated with the estimate
  </ResponseField>

  <ResponseField name="contactDetails" type="object" required>
    Contact details for the estimate
  </ResponseField>

  <ResponseField name="issueDate" type="string" required default="2023-06-15T00:00:00.000Z">
    Date when the estimate was issued
  </ResponseField>

  <ResponseField name="expiryDate" type="string" required default="2023-07-15T00:00:00.000Z">
    Date when the estimate expires
  </ResponseField>

  <ResponseField name="sentBy" type="string" default="user@example.com">
    User who sent the estimate
  </ResponseField>

  <ResponseField name="automaticTaxesCalculated" type="boolean" required default="True">
    Indicates if automatic taxes were calculated
  </ResponseField>

  <ResponseField name="meta" type="object" required>
    Additional metadata associated with the estimate
  </ResponseField>

  <ResponseField name="estimateActionHistory" type="string[]" required>
    History of actions taken on the estimate
  </ResponseField>

  <ResponseField name="sentTo" type="object" required>
    Recipient details for the estimate
  </ResponseField>

  <ResponseField name="frequencySettings" type="object" required>
    Frequency settings for recurring estimates
  </ResponseField>

  <ResponseField name="lastVisitedAt" type="string" required default="2023-06-20T08:30:00.000Z">
    Timestamp when the estimate was last visited
  </ResponseField>

  <ResponseField name="totalamountInUSD" type="number" required default="1500.75">
    Total amount in USD
  </ResponseField>

  <ResponseField name="autoInvoice" type="object">
    Auto-invoice settings for the estimate
  </ResponseField>

  <ResponseField name="traceId" type="string" required default="010c7a01-857f-4619-970d-xyxyxyxy">
    Trace ID for logging and debugging
  </ResponseField>

  ```json theme={null}
  {
    "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
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId/send' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "altId": "6578278e879ad2646715ba9c",
    "altType": "account",
    "action": "sms_and_email",
    "liveMode": true,
    "userId": "6578278e879ad2646715ba9c",
    "estimateName": "Estimate"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId/send', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "action": "sms_and_email", "liveMode": true, "userId": "6578278e879ad2646715ba9c", "estimateName": "Estimate"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'POST',
      'https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId/send',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "action": "sms_and_email", "liveMode": true, "userId": "6578278e879ad2646715ba9c", "estimateName": "Estimate"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/invoices/estimate/YOUR_estimateId/send');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'action': 'sms_and_email', 'liveMode': true, 'userId': '6578278e879ad2646715ba9c', 'estimateName': 'Estimate'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
