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

https://api-sandbox.cleartax.com/middle-east/ksa/einvoicing/v1/emails

Request Headers

ParameterData TypeField ValidationsDescription

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

ParameterData TypeField ValidationsDescription

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

ParameterData TypeField ValidationsDescription

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

ParameterData TypeField ValidationsDescription

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

ParameterData TypeField ValidationsDescription

EmailTemplate

Object

Can not be null.

Mandatory, Subject in email.

CounterPartyDetails

List<Object>

Can not be null.

Mandatory.

Email Template Object

ParameterData TypeField ValidationsDescription

Type

String

Enum: INVOICE_GENERATED, INVOICE_PAYMENT_REMINDER

Counterparty Details Object

ParameterData TypeField ValidationsDescription

ContactDetails

List<Object>

Can not be Null

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

Contact Details Object

ParameterData TypeField ValidationsDescription

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 CodeDescription

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.

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

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

Last updated