> For the complete documentation index, see [llms.txt](https://docs.cleartax.in/cleartax-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cleartax.in/cleartax-docs/e-invoicing-api/e-invoicing-api-reference/cleartax-e-invoicing-apis-xml-schema/b2b-e-invoicing-apis/send-an-e-invoice-via-email.md).

# Send an E-Invoice via Email

You can use this API to send an E-Invoice via Email to your customers.&#x20;

### Request Method <a href="#request-method" id="request-method"></a>

POST

### **Request URL**

```
{{HOST}}/einv/v0/communication/send
```

### Request Headers

<table><thead><tr><th>Parameter</th><th width="158">Data Type</th><th width="183.3333740234375">Field Validations</th><th>Description</th></tr></thead><tbody><tr><td>X-Cleartax-Auth-Token</td><td>String</td><td>NA</td><td>Mandatory. The auth token generated from the ClearTax user id and password. </td></tr><tr><td>gstin</td><td>String</td><td>NA</td><td>Users GSTIN</td></tr></tbody></table>

### Request Path Params <a href="#request-path-params" id="request-path-params"></a>

There are no path parameters for this API.

### Request Query Params <a href="#request-path-params" id="request-path-params"></a>

There are no query parameters for this API.

### Request Body

<table><thead><tr><th>Parameter</th><th width="157.3333740234375">Data Type</th><th width="183">Field Validations </th><th>Description</th></tr></thead><tbody><tr><td>attachment_details</td><td>Object</td><td>NA</td><td>Mandatory, Attachment Details</td></tr><tr><td>communication_details</td><td>Object</td><td>NA</td><td>Mandatory, Communication Details like Template Type and Email Information</td></tr></tbody></table>

#### Attachment Details Object

<table><thead><tr><th>Parameter</th><th width="162.6666259765625">Data Type</th><th>Field Validations</th><th>Description</th></tr></thead><tbody><tr><td>invoice_details</td><td>Object</td><td>NA</td><td>Mandatory, Invoice Details for which E-Invoice is to be sent in attachments</td></tr></tbody></table>

**Invoice Details Object**

<table><thead><tr><th>Parameter</th><th width="158.6666259765625">Data Type</th><th>Field Validations</th><th>Description</th></tr></thead><tbody><tr><td>invoice_id</td><td>String</td><td><p>minLength: 1</p><p>maxLength: 16</p><p>pattern: "^([a-zA-Z1-9]{1}[a-zA-Z0-9\/-]{0,15})$"</p></td><td>Mandatory, Invoice/ Document Number</td></tr><tr><td>invoice_date</td><td>String</td><td>Format DD/MM/YYYY</td><td>Mandatory, Document Date</td></tr><tr><td>invoice_type</td><td>Enum</td><td>Enum Values: INV, CDN, DBN</td><td>Mandatory, Document Type: Invoice, Credit Note, or Debit Note</td></tr></tbody></table>

#### Communication Details

<table><thead><tr><th>Parameter</th><th width="161.3333740234375">Data Type</th><th>Field Validations</th><th>Description</th></tr></thead><tbody><tr><td>template</td><td>Object</td><td>NA</td><td>Mandatory, Template Type</td></tr><tr><td>contacts</td><td>List</td><td>NA</td><td>Mandatory, Contact Details</td></tr></tbody></table>

**Template Details Object**

<table><thead><tr><th>Parameter</th><th width="163.33331298828125">Data  Type</th><th>Validations</th><th>Description</th></tr></thead><tbody><tr><td>template_type</td><td>String</td><td>INVOICE_GENERATED, INVOICE_CANCELLED, INVOICE_PAYMENT_REMINDER</td><td>Mandatory</td></tr></tbody></table>

**Contact Details**

<table><thead><tr><th>Parameter</th><th width="162.66668701171875">Data Type</th><th>Field Validations </th><th>Description</th></tr></thead><tbody><tr><td>recipients</td><td>List</td><td>NA</td><td>Mandatory, Email Recipients - You can send multiple recipients for sending email</td></tr></tbody></table>

**Email Recipient Details**

<table><thead><tr><th>Parameter</th><th width="164">Data Type</th><th>Field Validations</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>String</td><td>maxLength: 100</td><td>Optional, Name of the Person</td></tr><tr><td>email</td><td>String</td><td>maxLength:100</td><td>Mandatory, Email of the Person</td></tr><tr><td>email_recipient_type</td><td>Enum</td><td>TO, CC, BCC</td><td>Mandatory, Scope of the Email</td></tr></tbody></table>

### Response Status Codes <a href="#response-status-codes" id="response-status-codes"></a>

| HTTP Status Code | Description                                                                  |
| ---------------- | ---------------------------------------------------------------------------- |
| 200              | For a successfully processed request (may be a success or validation error). |
| 401              | If the user is not authenticated for the operation.                          |
| 403              | If the user is not authorised for the operation.                             |
| 500              | If there are any unhandled exceptions on the Clear side.                     |

### Response Schema

<table><thead><tr><th width="180.66668701171875">Parameter</th><th width="150.33331298828125">Data Type</th><th>Field Validations</th><th>Description</th></tr></thead><tbody><tr><td>success</td><td>boolean</td><td>true, false</td><td><p><strong>true</strong> if request is successful, </p><p><strong>false</strong> if request got failed</p></td></tr><tr><td>errors</td><td>Object</td><td>NA</td><td>Details of errors, null in case of success</td></tr></tbody></table>

#### Error Details Object

<table><thead><tr><th width="181.33331298828125">Parameter</th><th width="148.66668701171875">Data Type</th><th>Field Validations </th><th>Description</th></tr></thead><tbody><tr><td>error_code</td><td>String</td><td>NA</td><td>Error Code </td></tr><tr><td>error_message</td><td>String</td><td>NA</td><td>Error Message</td></tr><tr><td>error_source</td><td>String</td><td>ClearTax</td><td>Error Source</td></tr></tbody></table>

### Sample Request and Response <a href="#sample-request-and-response" id="sample-request-and-response"></a>

#### **Request**

```json
{
  "attachment_details": {
   "printTemplate": "62cfd0a9-d1ed-47b0-b260-f8y6f57e9c5e",
   "invoice_details": {
      "invoice_id": "DOC-1",
      "invoice_date": "24/06/2025",
      "invoice_type": "INV"
    }
  },
  "communication_details": {
    "template": {
      "template_type": "INVOICE_GENERATED"
    },
    "contacts": [
      {
        "recipients": [
          {
            "name": "Contact Person Name",
            "email": "recipient@gmail.com",
            "email_recipient_type": "TO"
          }
        ]
      }
    ]
  }
}
```

#### Response - Success:&#x20;

**HTTP Status Code : 200 OK**

```json
{
    "success": true,
    "errors": null
}
```

#### Response - Failure:&#x20;

**HTTP Status Code : 200 OK**

```json
{
    "success": false,
    "errors": {
        "error_code": "300102",
        "error_message": "You don't have any data present for the selected Document Details",
        "error_source": "CLEARTAX"
    }
}
```

#### API Validations <a href="#api-validations" id="api-validations"></a>

Currently there are no known validations for this API.

#### API Constraints <a href="#api-constraints" id="api-constraints"></a>

The Invoice should be present in the ClearTax database.&#x20;
