Send E-Invoice via Email

You can use this API to send E-Invoices to your customers via the Email.

Request Method

POST

Request URL

{{BASE_URL}}/v1/emails

Replace the {{BASE_URL}} with the one mentioned here based on whether you are using sandbox or production.

Rate Limit : 10 API requests per minute

Request Headers

Parameter
Data Type
Field Validations
Description

x-cleartax-auth-token

String

Cannot be empty

Mandatory. User auth token.

VAT

String

Cannot be empty

Mandatory. VAT or Group VAT of the entity.

branch

String

Should be a valid branch from the user account

Optional. Branch name (store name) added in the user account which maps to a VAT or Group VAT of the entity.

Request Path Params

There are no path params for this API.

Request Query Params

There are no query params for this API.

Request Body

Parameter
Data Type
Field Validations
Description

Attachments

Object

Cannot be null

Mandatory. Attachment Details Object.

PreviewDetails

Object

Cannot be null

Mandatory, Communication Details like Template Type and Email Information.

Attachment Details Object

Parameter
Data Type
Field Validations
Description

documentDetails

List<Object>

Mandatory, Invoice Details for which e-Invoice is to be sent in attachments.

printTemplateId

String

Mandatory. Template id of the e-Invoice template that has to be sent. e.g., :- “39” (Standard Invoice Template).

documentType

String

Enum:

EINVOICE

Mandatory. Type of document that needs to be printed.

Document Details Object

Parameter
Data Type
Field Validations
Description

InvoiceNumber

String

Mandatory. Invoice Number (Invoice Reference Number).

IssueDate

String

YYYY-MM-DD

Mandatory

InvoiceType

String

Enum:

INV,CRN,DBN

Mandatory. INV - Invoice, CRN - Credit Note, DBN - Debit Note.

Seller VAT

String

Mandatory, This VAT should match with the header VAT.

Preview Details Object

Parameter
Data Type
Field Validations
Description

EmailTemplate

Object

Can not be null.

Mandatory, Subject in email.

CounterPartyDetails

List<Object>

Can not be null.

Mandatory.

Email Template Object

Parameter
Data Type
Field Validations
Description

Type

String

Enum: INVOICE_GENERATED, INVOICE_PAYMENT_REMINDER

Counterparty Details Object

Parameter
Data Type
Field Validations
Description

ContactDetails

List<Object>

Can not be Null

Mandatory, Email Recipients - You can send multiple recipients for sending email.

Contact Details Object

Parameter
Data Type
Field Validations
Description

Email

String

EmailRecipientType

String

Enum: TO, CC, BCC

Mandatory.

Sample Request

{
   "Attachments": {
       "documentDetails": [
     {
       "IssueDate": "2022-07-20",
       "InvoiceNumber": "2056",
       "InvoiceType": "INV",
       "Vat": "300492946900003"
     }
   ],
       "documentType": "EINVOICE",
       "printTemplateId": "40"
   },
   "PreviewDetails": {
   "Template": {
           "Type": "INVOICE_GENERATED"
       },
       "CounterParties": [
           {
               "Contacts": [
                   {
                       "Email": "dharmendra.maurya@cleartax.in",
                       "EmailRecipientType": "TO"
                   }
               ]
           }
       ]
       
   }
}

Response Status Codes

HTTP Status Code
Description

200

For a successful retrieval, if Invoice is not present, validation errors.

401

If the user is not authenticated for the operation.

403

If the user is not authorized for the operation.

429

Too many requests

5XX

Unhandled exception.

Sample Response (Success)

Success - HTTP Status Code - 200

Sample Response (Error)

HTTP Status Code - 200

Response Body

{
   "ErrorList": [
       {
           "ErrorCode": "6002",
           "ErrorMessage": "Document Number cannot be empty",
           "ErrorSource": "CLEARTAX",
           "Path": "attachments.documentDetails[0].documentNumber"
       }
   ]
}

API Validations

  1. All documents given should be present in CT system.

  2. printTemplateId should be present in CT system.

API Constraints

  1. All documents given should be in generated or failed state e.g., “CT QR Code status = GENERATED”.

  2. Each customer is allowed to send a limited number of requests per minute to prevent server overload. If the limit is exceeded, the server will respond with a 429 Too Many Requests status code.

Last updated