Create an Invoice

Request URL

POST: {{HOST}}/invoicing/v1/invoice

Request Headers

X-Cleartax-AuthToken: {{USER_AUTH_TOKEN}}
gstin: {{gstin_number}}
pan: {{pan_number}}
branch: {{branch_name}}
vendor: {{vendor_name}}
creator-pan: {{pan_number}}
PARAMETERDESCRIPTIONEXAMPLE VALUE

X-Cleartax-Auth-Token

Mandatory. The auth token generated from ClearTax user id and password.

208c5df0-b252-4271-a23d- 61b384b58bfc

gstin

Mandatory. GSTIN number (Should be Empty for Cash Memo). GSTIN should be same as Seller GSTIN

29AAFCD5862R000

pan

Optional. PAN number

AAFCD5862R

branch

Optional. Branch Name

Bangalore

vendor

Conditional. For invoice generation on behalf of Vendors. Should be empty for Self generating Invoices

Vendor Name

creator-pan

Conditional. Pan number of business entity that is creating invoices for vendors. Should be empty for Self generating Invoices

PAN number for creator

Request Payload Schema

PARAMETERPARAMETER TYPEDESCRIPTION

documentDetails

Object

Mandatory. This section includes parameters such as type of document, e-commerce provider’s GSTIN, tax currency code, timestamp,etc.

sellerDetails

Object

Mandatory. This section includes parameters such as the name of the seller, GSTIN, contact details, the logo of the seller’s business, etc.

dispatchDetails

Object

Optional. This section includes parameters such as the details of the person who dispatches the goods.

buyerDetails

Object

Conditional. Buyer details object. Mandatory for Non-B2C transactions and Cash Memo. This section includes parameters such as the name of the buyer, GSTIN, contact details, place of supply, etc.

shippingDetails

Object

Optional. This section includes the details of the person to whom the goods are to be shipped.

exportDetails

Object

Optional. Export details object. This section includes parameters such as export duty, export country code/port code, shipping details, etc.

It is required only in the case of exports.

additionalDiscounts

List

Optional. This section includes parameters such as the discount amount and the reason for the same. Examples for an additional discount: Target discount, festival sale discount, etc.

additionalCharges

List

Optional. This section includes parameters such as the additional charges amount and the reason for the same.

An example for additional charges would be packing charges, insurance, freight etc.

paymentInstrumentDetailsAndTerms

Object

Optional. This section includes parameters such as supplier’s bank account details, credit period, the interest rate in case of delay and other payment terms.

paymentReceivedDetails

List

Optional. This section includes parameters such as payer’s name, payment mode, date of payment, amount paid, etc.

metadata

Object

Mandatory. Additional metadata. This section includes parameters like terms and conditions for the document, notes, signature image, etc.

referenceDocuments

Object

Conditional. Details of referenced documents. This section includes parameters related to the linked documents and order reference details.

It is mandatory where credit notes, debit notes and refund notes are issued.

additionalDocumentDetails

List

Optional. This section includes parameters such as attachment type (document/URL/QR code) and description of the same.

lineItems

List

Mandatory. Line Items. This section includes parameters such as item serial number, item name, description, quantity, HSN code, tax rate, tax amount, etc.

valueDetails

Object

Optional. Total Value Details. This section includes parameters related to total value details.

shouldGenerateEInvoice

Boolean

Optional. This flag will be used to generate E-Invoice. If successful IRN or Payment QR Code will be returned else Error Details.

Document Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

timestamp

DateTimeFormat (dd-MM-yyyy HH:mm:ss)

Date: minLength: 10

maxLength: 10,

pattern: "^[0-3][0-9]\-[0-1][0-9]\-[2][0][1-2][0-9]$" Time: minLength: 8 maxLength: 8, Format: 24 hours Note: If time is unknown, then pass 00:00:00

Mandatory. Date and time of the creation of the Invoice is recorded here.

For eg.- 22-01-2022 02:30:45

It is proof of the moment or time that helps to know when the validity of the invoice starts.

documentType

Document Type (ENUM)

Document Type : ENUM

Mandatory. A correct document type needs to be passed here.

An invoice can be in different forms. For example, tax invoice, credit note, debit note, delivery challan, refund voucher, cash memo, advance receipt, etc.

Each type of invoice has different usage.

It is important to mention the type of document at the top to help identify it easily.

supplyType

Supply Type (ENUM)

Supply Type : ENUM

Conditional. Mandatory for non Cash Memo documents. The supply type of the transaction should be captured here.

Here are the types of supplies:

Selling goods or services to another business (B2B)

Selling goods or services to the customer (B2C) Selling goods or services to

SEZ by making GST payment

Selling goods or services to SEZ without making GST payment

Exporting goods or services by making GST payment

Exporting goods or services without making GST payment

Deemed exports

Distribution of Input Tax Credit (ITC) by Input Service Distributor (ISD) to its branches Bill of Supply

orderId

String

Should be unique for each document. If repeated, will be considered a duplicate request.

For example- 1001001112

Alphanumeric characters & special characters (/ . - ) are allowed.

Mandatory. OrderId. Order number or order ID is a unique number assigned to every order by the seller to keep track of it.

It is useful to the seller to identify the order placed by the customer and find details for the same order depending on the data set up in their system.

For example, if a customer places an order, the said order is assigned a unique number which is never assigned again to any other document. Even if there is a credit note or debit note for referring to the said order, the order ID of such documents will be different.

Eg: If a user issues an invoice to the customer with order id ABC and later due to some changes a credit note has to be issued against it then the order id should be different such as XYZ

documentNoPrefix

String

Alphabets and numbers are allowed here.

You can also use special characters- “/”, “-”.

The first character cannot be 0, “/”, “-” Prefix should end with a “/” or “-”

Min length: 1

Max length: 10

For tax invoices, the maximum allowable length for a complete invoice number is 16 characters (Prefix + Serial number)

Mandatory. Document prefix. The document prefix should be passed here. It is a tag added at the beginning of the document number. It can be letters or numbers that can help further identify the transactions.

A prefix in a document number makes them instantly recognisable.

We will add the next incremental number to the prefix to create a complete invoice number. For example, a company can choose to enter prefix RJS/for its branches in Rajasthan and prefix GJR/for its Gujarat branches,

In response, the invoice number will be RJS/456 or GJR/897

isReverseChargeApplicable

Boolean

The default value is False

It can be set as "True" in case of B2B invoices, B2B Credit Note and B2B Debit Note.

Optional. The input value will be “True” if the tax liability is payable under the reverse charge mechanism, i.e. when the liability to pay GST is on the recipient of goods or services instead of the supplier. The reverse charge is applicable only on notified categories of goods or services.

isIgstApplicableOnIntraState

Boolean

If “True” is selected, then note that- IGST needs to be levied irrespective of the supplier state and place of supply. Reverse charge applicability will always be “Yes”.

Optional. If “True” is selected, it indicates that the supply is intrastate but chargeable to IGST.

By default, it will be “False”.

For example, it will be “True” in the case of transfer of Priority Sector Lending Certificate (PSLC) by a bank to another bank under RBI regulations within the same state.

ecommerceProviderGstin

String

minLength: 15

maxLength: 15

pattern: "^([0-9]{2}[0-9A-Z]{13})$" The tax collector's GSTIN should be passed here.

Optional. E-commerce Provide GSTIN. GSTIN of e-commerce provider should be tagged here.

GSTIN is a unique 15-digit unique identification number which is also called a GST registration number.

When an e-commerce provider is involved in a transaction between seller and buyer, the GSTIN of the e-commerce provider should be mentioned for TCS purposes. Examples of e-commerce providers: Amazon, Flipkart, Meesho.

documentCurrencyCode

Currency Code (ENUM)

minLength: 3 maxLength: 3, pattern : Alphabets ENUM

Optional. It is a three-letter alphabetic code that represents various currencies used for the transactions.

The default document currency code is “INR”.

taxCurrencyCode

Currency Code (ENUM)

minLength: 3 maxLength: 3, pattern : Alphabets ENUM

Optional. It is a three-letter alphabetic code that represents various currencies used for the transaction. The tax currency code will always be “INR”.

documentPeriodDetails

Object

-

Optional. Document Period Details. This section includes the start date and the end date for the summary invoices.

customFields

Custom Fields (List)

-

Optional. It is a section where the user can add any number of custom fields and put them in the object.

Document Period Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

startDate

Date (dd-MM-yyyy)

Date : minLength: 10

maxLength: 10,

pattern: "^[0-3][0-9]\-[0-1][0-9]\-[2][0][1-2][0-9]$". Future dates are not acceptable.

For Eg.- DD-MM-YYYY

Optional. Start Date for the Transaction. The start date of the invoice to be passed here.

It is the date of initiation of the transaction.

For example:

If the goods are supplied on the 1st day of the month and the invoice for the same is generated at the end of the month. Then the start date of the invoice will be the 1st day of the month.

endDate

Date (dd-MM-yyyy)

Date : minLength: 10

maxLength: 10,

pattern: "^[0-3][0-9]\-[0-1][0-9]\-[2][0][1-2][0-9]$". Future dates are not accepted.

For Eg.- DD-MM-YYYY

Optional. End date for the Transaction. This is the end date of a summary Invoice generated for a transaction spanning across more than one day.

Summary Invoice can be also called a consolidated invoice. It is an invoice that aggregates many transactions onto a single document, enabling a single payment each month. This is mostly followed by the enterprises who have multiple transactions with their customers in a month for which consolidating monthly transactions of the customers becomes easier.

Please note, this is not the invoice payment due date.

Custom Fields

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

name

String

-

Optional. Name for the custom key. These are sample custom fields. In case the user wants to add certain information at the invoice level which should be printed on the invoice, the user can define their own custom fields and add in this object.

Eg: if a maintenance company wants to add the sq ft. area of the property on the top of the invoice

Or an insurance company wants to add the insurance number on top of the invoice.

In these cases, the user can add any number of custom fields and put them in the object.

value

String

-

Optional. Value for the custom key.

Seller Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

tradeName

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$". The characters can be alphanumeric or special characters.

Optional. Trade Name. Trade name of the supplier to be passed here.

A trade name in GST is the name through which the business is normally called and the name used for advertising and marketing of the company.

Eg.- ClearTax’s legal name is Defmacro Software Pvt. Ltd. However, it is normally known by ClearTax.

legalName

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Mandatory. Legal Name. The name entered at the time of the formation of the business or incorporation of the company should pass.

address

Address (Object)

-

Mandatory. Address Details. This section includes parameters such as address line 1, line 2, pincode, state code, etc.

gstin

String

minLength: 15

maxLength: 15

pattern: "([0-9]{2}[0-9A-Z]{13})"

Mandatory except for Cash Memo. GSTIN. The seller’s GSTIN should be tagged here.

GSTIN is a unique 15-digit Goods and Services Tax Identification Number or GST registration number.

The dealers who are registered under the GST law are provided with the GSTIN.

pan

String

minLength: 10

maxLength: 10

pattern: "([0-9A-Z]{10})"

Optional. Seller’s Permanent Account Number (PAN) to be passed here.

phone

String

minLength: 6

maxLength: 12

pattern: "^([0-9]{6,12})$"

Optional. Supplier’s phone number details to be passed here.

email

String

minLength: 6

maxLength: 100

pattern: "^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$"

Optional. Seller’s email ID details need to be passed here. Every invoice needs the business information on it, and apart from the business name, address, and phone number, the email address of the supplier is also necessary.

logoImage

String

The image URL or base64 of the image is to be passed here.

Optional. A logo image of the supplier is to be printed on the invoice.

The logo image on the invoice helps make the document easily recognisable.

The image provided is to be printed on the PDF.

The image can be provided in 3 forms to the team: A static image during onboarding will be added to the settings of user. The URL of the image can be passed here. Base64 of the Image

Address

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

line1

String

minLength: 1

maxLength: 100

pattern: "^([^\\\"])*$"

Mandatory. Address Line 1. Primary address information of the business is required here.

The document will show the first line of the address of the business in this field. If the address exceeds the maximum length, it can be continued in line 2.

line2

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Optional. Address Line 2. If the address is not completed in line 1, continue it in line 2.

location

String

minLength: 3

maxLength: 50

pattern: "^([^\\\"])*$"

Mandatory. Location. City should be passed here.

pincode

String

minimum: 100000

maximum: 999999 ENUM

Mandatory. The pincode number needs to be passed here.

stateCode

String

Mandatory. The state code of the GSTIN needs to be passed here.

Dispatch Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

gstin

String

minLength: 15

maxLength: 15

pattern: "([0-9]{2}[0-9A-Z]{13})"

Optional. GSTIN of the person dispatching the goods.

pan

String

minLength: 10

maxLength: 10

pattern: "([0-9A-Z]{10})"

Optional. Permanent Account Number (PAN) of the person dispatching the goods.

tradeName

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Optional. Trade name of the entity dispatching the goods

legalName

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Mandatory. Legal name of the entity dispatching the goods

address

Address (Object)

-

Conditional. This section includes parameters such as address line 1, line 2, pincode, state code, etc.

This is required only if the ‘dispatch from’ address is different from the seller’s address. It is not applicable for advance receipt of the goods.

Buyer Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

name

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Mandatory for B2B, EXPWP, EXPWOP, SEZWP, SEZWOP, DEXP Optional for B2C, BOS and Cash Memo

tradeName

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Optional. A trade name in GST is the name through which the business is normally called and the name used for advertising and marketing of the company.

legalName

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Conditional (Mandatory for non B2C). Legal Name of the buyer. The name entered at the time of the formation of the business or incorporation of the company should pass.

address

Address (Object)

Conditional (Mandatory for non B2C). Address Details. This section includes parameters such as address line 1, line 2, pincode, state code, etc.

gstin

String

minLength: 15

maxLength: 15

pattern: "([0-9]{2}[0-9A-Z]{13})". For export buyer’s, GSTIN should be “URP”

Optional. GSTIN of the buyer. GSTIN is a unique 15-digit Goods and Services Tax Identification Number or GST registration number.

pan

String

minLength: 10

maxLength: 10

pattern: "([0-9A-Z]{10})"

Optional. Buyer’s Permanent Account Number (PAN).

phone

String

minLength: 6

maxLength: 12

pattern: "^([0-9]{6,12})$"

Optional. Buyer’s phone number.

email

String

minLength: 6

maxLength: 100

pattern: "^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$"

Optional. Email of the buyer.

placeOfSupply

String

Mandatory . The place of supply of the goods or services should be passed here.

The place of supply of goods or services under GST decides whether the transaction should be considered as intrastate to charge CGST & SGST/UTGST or considered as interstate to charge IGST.

Shipping Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

name

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Optional. Name of the person to whom the goods are shipped.

tradeName

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Optional. Trade name of the organisation shipping the goods. A trade name in GST is the name through which the business is normally called and the name used for advertising and marketing of the company.

legalName

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$"

Mandatory. The legal name of the person to whom the goods are shipped. The name entered at the time of the formation of the business or incorporation of the company (customer) should pass.

address

Address (Object)

-

Conditional. This section includes parameters such as address line 1, line 2, pincode, state code, etc.

This is required only if the ‘ship to’ address is different from the buyer’s address. It is not applicable for advance receipt of the goods.

gstin

String

minLength: 15

maxLength: 15

pattern: "([0-9]{2}[0-9A-Z]{13})"

Optional. GSTIN of the person to whom the goods are shipped.

phone

String

minLength: 6

maxLength: 12

pattern: "^([0-9]{6,12})$"

Optional. Phone numbers of individuals who receive the shipped goods

pan

String

minLength: 10

maxLength: 10

pattern: "([0-9A-Z]{10})"

Optional. Permanent Account Number (PAN) of individuals who receive the shipped goods.

Export Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

countryCode

Country Code(ENUM)

minLength : 2 maxLength: 2, pattern: "([A-Z]{2})"

Optional. Country codes need to be passed here in case the supply type is EXPWP or EXPWOP, i.e. in the case of exports. Using the country codes, one can easily find out information about a shipment and its country.

shippingPortCode

Shipping Port Code(ENUM)

minLength: 6 maxLength: 6

Optional. Shipping Port Code. The shipping bill is a document for customs clearance for the export of goods.

The shipping bill includes the shipping port code, shipping bill date and shipping bill number.

Exporters supplying goods with payment of IGST will need shipping bill details for claiming refund of IGST so paid.

This is because the shipping bill having GST invoice details is considered as an application for claiming a refund of IGST paid on such exports.

conversionFactor

Decimal

Only numbers accepted.

Decimals are allowed.

To be filled only if the supply type is “EXPWP” or “EXPWOP”.

Optional. The conversion factor means the exchange rate needs to be passed here.

The exchange rate is specified on the Bill of Export issued by Custom authorities.

If exchange rates are known, currency conversions can be done by dividing the current currency by the exchange rate.

shippingBillNumber

String

minLength: 1

maxLength: 20

pattern: "^([^\\\"])*$" Inputs are required only in the case of exports of goods.

Optional. The shipping bill is a document for customs clearance for the export of goods.

The shipping bill includes the shipping port code, shipping bill date and shipping bill number.

Exporters supplying goods with payment of IGST will need shipping bill details for claiming refund of IGST so paid. This is because the shipping bill with GST invoice details is considered as an application for claiming a refund of IGST paid on such exports.

shippingBillDate

Date (dd-MM-yyyy)

minLength: 10

maxLength: 10

pattern: "^[0-3][0-9]\-[0-1][0-9]\-[2][0][1-2][0-9]$" Future dates are not acceptable.

Input is required only in the case of exports of goods.

Optional. The shipping bill date is the date mentioned on the shipping bill.

The shipping bill is an essential document required for getting customs clearance to export goods.

The shipping bill includes the shipping port code, shipping bill date and shipping bill number.

Exporters supplying goods with payment of IGST will need shipping bill details for claiming refund of IGST so paid.

This is because the shipping bill with GST invoice details is considered as an application for claiming a refund of IGST paid on such exports.

exportDuty

Decimal

Inputs are required only in the case of exports.

Optional. The tax levied on the export of goods is called an export duty.

The tax rate needs to be passed here.

Additional Discounts

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

reason

Reason

Alpha-Numeric value

Optional. The reason for additional discount given to the customer at invoice level should be passed here.

For example, target discount, festival sale discount, etc.

amount

Decimal

Only Numeric

Optional. The additional discount amount.

Additional Charges

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

reason

Reason

Alpha-Numeric value

Optional. The reason for additional charges levied to the customer should be passed here.

For example, Shipping charges or Packing Charges etc.

amount

Decimal

Only Numeric

Optional. Additional charges.

Payment Instrument and Terms

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

accountName

String

minLength: 1

maxLength: 100

pattern: "^([^\\\"])*$"

Optional. Name of the bank account of where the payment of the invoice would be expected should be passed here.

The bank account name mentioned in the document will enable the buyer to make payment to the correct bank account.

ifscCode

String

minLength: 1

maxLength: 11

pattern: "^([^\\\"])*$"

Optional. IFSC code of the respective bank account should be entered.

The IFSC code mentioned in the document will enable the customer to make payment to the supplier in their bank account.

accountNumber

String

minLength: 1

maxLength: 18

pattern: "^([^\\\"])*$"

Optional. A valid bank account number of where the payment of the invoice would be expected should be passed here.

The bank account number mentioned in the document will enable the buyer to make payment to the correct bank account.

upiId

String

yourname@bankname

Optional. The UPI ID of the seller should be passed here.

By sending the UPI ID, the seller sends a virtual payment address of their bank account to the customer. The customer can use the same UPI ID while making payments to the seller’s bank account.

paymentTerms

String

minLength: 1

maxLength: 100

pattern: "^([^\\\"])*$"

Optional. The terms of payment should be entered.

Eg: Cash payments are not allowed.

Cash on Delivery.

paymentInstruction

String

minLength: 1

maxLength: 100

pattern: "^([^\\\"])*$" Eg: The amount of advance and the installment details if any.

Optional. Payment instructions should be passed here.

creditDays

Integer

minimum: 0

maximum: 9999

Optional. The number of credit days should be passed here.

Credit days are the number of days which the customer is allowed to wait before paying the amount of an invoice.

creditTransferTerms

String

minLength: 1

maxLength: 100

Optional. The payment terms should be mentioned by the supplier.

Eg: Interest rate in case of delay in payment, payment due in advance, payment due upon receipt, etc.

directDebitTerms

String

minLength: 1

maxLength: 100

pattern: "^([^\\\"])*$"

Optional. Direct debit is a procedure where sellers are allowed to automatically take funds from the bank account of buyers as per the agreed terms. If there is any ‘direct debit’ agreement between the seller and buyer, the terms of the same should be mentioned here.

Payment Received Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

payerName

String

minLength: 1

maxLength: 100

pattern: "^([^\\\"])*$"

Optional. The name of the payer.

paymentMode

String

minLength: 1

maxLength: 18

pattern: "^([^\\\"])*$"

Optional. Mode of payment should be passed here.

For Eg: Cash UPI Net Banking

paymentTransactionId

String

-

Optional. Payment transaction ID should be passed here.

paymentDate

DD-MM-YYYY

minLength: 10

maxLength: 10,

pattern: "^[0-3][0-9]\-[0-1][0-9]\-[2][0][1-2][0-9]$".

Optional. Date of payment of the supply should be passed here.

paidAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. Amount received from the customer should be passed here.

Invoice Metadata Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

termsAndCondition

String

Optional. Terms and conditions for printing on the document to be passed here.

notes

String

Optional. Notes for the invoice should be passed here.

documentLinkingId

String

All documents created and linked on the “Linked Document Schema” should have the same documentLinkingId

Optional. For all the documents that are linked in the “Linked Document Schema” you can use this field as an alias to search for all related documents.

Eg: your company might have a Job id or Project id and all documents created against it are linked. You could use the same alias here and use it to search all documents related to that Job or Project.

signatureImage

String

The signature image should be provided

Optional. Signature image of the supplier should be passed here.

The image can be provided in 3 forms to the team: A static image during onboarding will be added to the settings of user. The URL of the image can be passed here. Base64 of the image.

printTemplateId

String

Note : Custom Print Template ID please reachout to ClearTax Support

Optional. You will be provided with a unique printTemplateid for your documents. Where all the information is printed on that template id. Please request the engineering team at Clear for the respective value.

Reference Document Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

linkedDocumentsDetails

List

minLength: 1 maxLength: 16.

It should end with "/" or "-" only.

Conditional. It is a conditional field. This section includes parameters related such as document type, document number and document date of the original Invoice. Mandatory for Credit Note, Debit Note and Refund Notes

orderReferenceDetails

List

Optional. This section includes parameters such as contract reference number, purchase order reference number, project reference number, etc.

Linked Document Details

PARAMETERPARAMTER TYPEFIELD VALIDATIONSDESCRIPTION

documentNumber

String

minLength: 1 maxLength: 16.

It should end with "/" or "-" only. The first letter cannot be 0, “/”, “-”.

Mandatory. The document number of the documents linked with the transaction should be passed here.

Use this field to link connected documents to each other.

Eg: Invoice 1234 could be connected to Credit Note 4567 and an Advance Voucher of 7890.

documentDate

Date (dd-MM-yyyy)

minLength: 10

maxLength: 10,

pattern: "^[0-3][0-9]\/[0-1][0-9]\/[2][0][1-2][0-9]$". Mandatory for Credit Notes,Debit Notes and Refund Notes.

Future dates are not acceptable.

For Eg: DD-MM-YYYY

Mandatory. The date of the documents linked with the transaction should be passed here.

Use this field to link connected documents to each other.

Eg: Invoice 1234 could be connected to Credit Note 4567 and an Advance Voucher of 7890.

documentType

Document Type (ENUM)

Document Type : Invoice, Credit Note, Debit Note

Mandatory. The type of the document linked should be passed here.

It can be an Invoice, Cash Memo, Credit Note, etc.

Use this field to link connected documents to each other.

Eg: Invoice 1234 could be connected to Credit Note 4567 and an Advance Voucher of 7890.

Order Reference Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

receiptAdviceNo

String

minLength: 1

maxLength: 20

pattern: "^([^\\\"])*$" The characters can be alphanumeric

Optional. Receipt advice number of goods supplied should be passed here.

receiptAdviceDate

Date (dd-MM-yyyy)

minLength: 10

maxLength: 10

pattern: "^[0-3][0-9]\-[0-1][0-9]\-[2][0][1-2][0-9]$"

Optional. Receipt advice date of the goods supplied should be passed here.

batchReferenceNo

String

minLength: 1

maxLength: 20

pattern: "^([^\\\"])*$"

Optional. The reference number of the batch of sales should be passed here.

Use this in accordance to the terminology used in your organisation. The terminology may vary so you can choose to map it according to these fields.

contractReferenceNo

String

minLength: 1

maxLength: 20

pattern: "^([^\\\"])*$"

Optional. The number of the contract to be referenced should be passed here.

Use this in accordance to the terminology used in your organisation. The terminology may vary so you can choose to map it according to these fields.

otherReferenceNo

String

minLength: 1

maxLength: 20

pattern: "^([^\\\"])*$"

Optional. Any other reference number of the contract to be referenced should be passed here.

Use this in accordance to the terminology used in your organisation. The terminology may vary so you can choose to map it according to these fields.

projectReferenceNo

String

minLength: 1

maxLength: 20

pattern: "^([^\\\"])*$"

Optional. The project number to be referenced in the invoice should be passed here.

Use this in accordance to the terminology used in your organisation. The terminology may vary so you can choose to map it according to these fields.

poReferenceNo

String

minLength: 1

maxLength: 16

pattern: "^([^\\\"])*$"

Optional. The number of the purchase order to be referenced should be passed here.

Use this in accordance to the terminology used in your organisation. The terminology may vary so you can choose to map it according to these fields.

poReferenceDate

Date (dd-MM-yyyy)

minLength: 10

maxLength: 10

pattern: "^[0-3][0-9]\-[0-1][0-9]\-[2][0][1-2][0-9]$"

Optional. The date of the purchase order to be referenced should be passed here. Use this in accordance to the terminology used in your organisation. The terminology may vary so you can choose to map it according to these fields.

Additional Document Details

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

id

String

-

Optional. ID

attachmentType

String

minLength: 3

maxLength: 100

pattern: "^([^\\\"])*$" The attachment type can be URL, doc, QR code.

Mandatory. The attachment type should be passed here.

The attachment type can be URL or doc or QR code.

value

String

-

Mandatory. Value.

description

String

minLength: 3

maxLength: 1000

pattern: "^([^\\\"])*$"

Optional. Description of the additional document attached should be passed here.

Line Item Details

Either of Price per unit and Quantity or Taxable Amount should be Present.

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

serialNumber

Number

minLength: 1

maxLength: 6

pattern: "^([0-9]{1,6})$"

Optional. The serial number of items should be entered. Ideally start with 1 to the number of items to be put in the invoice.

name

String

Min length: 3

Max length: 3006

Pattern: "^([^\"])*$"

Mandatory. The name of the item should be passed here. It will be the data that should be shown in the invoice item table

description

String

minLength: 3

maxLength: 300

pattern: "^([^\\\"])*$" If not provided, then it will be blank.

Optional. The item description should be passed here.

Examples for the description would be refrigerators, televisions, washing machines, etc.

isService

Boolean

minLength: 1

maxLength: 1,

Values: "Y", "N"

Optional. True if IsService, False for Goods.

hsnCode

String

minLength: 6

maxLength: 8

pattern: "^(?!0+$)([0-9]{4}|[0-9]{6}|[0-9]{8})$" If supply is of service, then the HSN code should start with "99"

Conditional. HSN code for the goods and SAC code for services should be passed here.

skuCode

String

Alpha-Numeric

Optional. The SKU code of the item should be passed here. The SKU code is created & maintained by the user system.

taxRate

Decimal

minimum: 0,

maximum: 999.999 Applicable, if supply is taxable.

The tax rate slab has a total of 11 tax rates (0, 0.1, 0.25, 1, 1.5, 3, 5, 7.5, 12, 18, 28)

If the CGST & SGST rate is provided, then the tax rate is the SGST rate + CGST rate.

If the IGST rate is provided then the tax rate is the IGST rate.

Conditional. Tax rate for the supply should be passed here.

pricePerUnit

Decimal

minimum: 0

maximum: 999999999999.999

Optional. Price per unit of the items should be passed here. The price mentioned here is the price without tax.

discountPerUnit

Decimal

minimum: 0

maximum: 999999999999.99

Optional. The discount per unit of the item should be passed here.

taxableAmount

Decimal

minimum: 0

maximum: 999999999999.99 Taxable value can be computed as->

(Quantity x Price per unit) - Total discount amount.

Conditional. Taxable amounts should be passed here.

If this is not provided then it will be auto computed, given if price per unit is present

cessRate

Decimal

minimum: 0

maximum: 999.999

Optional. Cess rate as per the item should be passed here.

Where the goods or service attracts GST cess, it should be calculated on the basis of the taxable value of the supply and as provided in the GST cess rate schedule.

For example, motor vehicles used for transport shall be charged a cess of 15%.

stateCessRate

Decimal

minimum: 0

maximum: 999.999

Optional. State cess rate should be entered, if any applicable.

cessNonAdvolAmount

Decimal

minimum: 0

maximum: 999999999999.99 Eg: The export of shellac and lac based products attract cess at the rate of Rs. 2.30 per quintal.

Optional. “Cess non-advol amount” means non-advolerum cess, i.e. it is charged fixed in terms of quantity and not charged as a percentage on value.

Notified cess as per quantity will be passed here.

stateCessNonAdvolAmount

Decimal

minimum: 0

maximum: 999999999999.99 Eg: The export of shellac and lac based products attract cess at the rate of Rs. 2.30 per quintal.

Optional. “Cess non-advol amount” means non-advolerum cess, i.e. it is charged fixed in terms of quantity and not charged as a percentage on value.

Notified cess as per quantity will be passed here.

quantity

Decimal

minimum: 0

maximum: 999999999999.99 For services - it will be “0” or “1”

Optional. The quantity of the supply item should be passed here.

unitOfMeasurement

UOM (ENUM)

minLength: 3

maxLength: 8 Mandatory in case of the supply of goods.

Conditional. The unit of measurement of goods should be passed here.

For example: For 10 kilograms of wheat, the unit of measurement is ‘Kilogram’ and the UQC is “KGS”.

otherCharges

Decimal

minimum: 0

maximum: 999999999999.99

Optional. The other charges should be passed here.

taxCategory

Tax Category (ENUM)

ENUM: NIL_RATED

NONGST

EXEMPT

Optional. Default value in case of Bill of Supply is taken as NIL_RATED

customFields

List (Custom Fields)

-

Optional. It is a section where the user can add any number of custom fields and put them in the object.

discount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The discount amount of supply should be passed here.

igstAmount

Decimal

minimum: 0

maximum: 99999999999999.99 If “Intrastate supply attracts IGST” is equal to “true”, then IGST will be applicable ( even if the place of supply and supplier state are the same). If IGST is applicable in SEZ transactions or any other transactions, always IGST will be applicable. In case SEZ developer is the supplier, then only IGST tax rates are applicable irrespective of supplier state code and place of supply code. If applicable, then compute it as->

Taxable value x Tax Rate.

Optional. IGST amount as per the item should be passed here.

Applicable if the place of supply is different from the supplier state.

sgstAmount

Decimal

minimum: 0

maximum: 99999999999999.99 Applicable when the place of supply = supplier state except if igstOnIntraStateTransaction is “true”.

Not applicable, if supply type is “Bill of supply”

If applicable, then compute it as->

Taxable value x taxable rate/2

Optional. SGST amount as per the item should be passed here.

cgstAmount

Decimal

minimum: 0

maximum: 99999999999999.99 This field is applicable when the place of supply = supplier state except when igstOnIntraStateTransaction is “true”.

It is not applicable if the supply type is “Bill of supply” If applicable, then compute it as ->

Taxable value x taxable rate/2

Optional.CGST amount as per the item should be passed here.

cessAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. Cess amount should be passed here.

stateCessAmount

Decimal

minimum: 0

maximum: 99999999999999.99 Should be computed as->

Taxable value *state cess rate

Optional. The state cess amount of the supply should be passed here.

Where the goods or service attracts GST cess, it should be calculated on the basis of the taxable value of the supply and as provided in the GST cess rate schedule.

grossAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The gross total amount of the supply should be passed here.oss Amount

totalItemValue

Decimal

minimum: 0

maximum: 99999999999999.99

Conditional. Total value of the item should be passed here.

Value Details

If the below fields are left blank we will compute it using the Item list details. If the data is not blank then we will validate with your computation

PARAMETERPARAMETER TYPEFIELD VALIDATIONSDESCRIPTION

totalTaxableAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The total taxable amount is to be passed here.

totalCgstAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The total CGST amount should be passed here.

totalIgstAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The total IGST amount should be passed here.

totalSgstAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The total SGST amount should be passed here.

totalCessAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The total cess amount should be passed here.

totalStateCessAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The total state cess amount should be passed here.

totalDiscountAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The total discount amount should be passed here.

totalAdditionalChargeAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. Total of additional charges levied to be passed here.

totalRoundOffAmount

Decimal

minimum: -99.99

maximum: 99.99

Optional. The total round off amount should be passed here.

totalAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The total amount of supply to be passed here.

totalTaxAmount

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The total tax amount should be passed here.

totalAmountInForeignCurrency

Decimal

minimum: 0

maximum: 99999999999999.99

Optional. The amount in foreign currency to be passed here.

This is applicable in the case of exports.

Sample Request

{
    "documentDetails": {
        "timestamp": "21-12-2021 00:00:00",
        "documentType": "Tax Invoice",
        "supplyType": "B2B",
        "orderId": "OrderId-1",
        "documentNoPrefix": "INV/",
        "isReverseChargeApplicable": false,
        "isIgstApplicableOnIntraState": false,
        "ecommerceProviderGstin": null,
        "documentCurrencyCode": "INR",
        "taxCurrencyCode": "INR",
        "documentPeriodDetails": {
            "startDate": "01-12-2021",
            "endDate": "15-12-2021"
        },
        "customFields": [
            {
                "name": "key",
                "value": "value"
            }
        ]
    },
    "sellerDetails": {
        "tradeName": "ClearTax",
        "legalName": "DEFMACRO SOFTWARE PRIVATE LIMITED",
        "address": {
            "line1": "Block 1, First Floor",
            "line2": "HOSUR MAIN ROAD, Bengaluru (Bangalore) Urban",
            "location": "BANGALORE",
            "pincode": "560058",
            "state": "KARNATAKA",
            "stateCode": "24"
        },
        "pan": "AAFCD5862R",
        "gstin": "29AAFCD5862R000",
        "logoImage": "",
        "phone": "022-3322322",
        "email": "support@cleartax.in"
    },
    "dispatchDetails": {
        "pan": "AAFCD5862R",
        "gstin": "29AAFCD5862R000",
        "tradeName": "ClearTax",
        "legalName": "DEFMACRO SOFTWARE PRIVATE LIMITED",
        "address": {
            "line1": "Block 1, First Floor",
            "line2": "HOSUR MAIN ROAD, Bengaluru (Bangalore) Urban",
            "location": "BANGALORE",
            "pincode": "560058",
            "state": "KARNATAKA",
            "stateCode": "24"
        }
    },
    "buyerDetails": {
        "name": null,
        "tradeName": "AMAZON INDIA",
        "legalName": "PREM LATA KOTHARI",
        "address": {
            "line1": "6/101, GALI NO 4",
            "line2": "VISHWAS NAGAR, DELHI, ",
            "location": "East Delhi",
            "pincode": "110032",
            "state": "Delhi",
            "stateCode": "7"
        },
        "placeOfSupply": "Delhi",
        "pan": "ACZPK9220B",
        "gstin": "07ACZPK9220B1ZG",
        "phone": "121323232333",
        "email": "admin@amazon.com"
    },
    "shippingDetails": {
        "name": null,
        "tradeName": "AMAZON INDIA",
        "legalName": "PREM LATA KOTHARI",
        "gstin": "07ACZPK9220B1ZG",
        "pan": "ACZPK9220B",
        "address": {
            "line1": "6/101, GALI NO 4",
            "line2": "VISHWAS NAGAR, DELHI, ",
            "location": "East Delhi",
            "pincode": "110032",
            "state": "Delhi",
            "stateCode": "7"
        }
    },
    "exportDetails": {
        "countryCode": "US",
        "shippingPortCode": "INADA6",
        "conversionFactor": 0.013,
        "shippingBillNumber": "SPA1332432",
        "shippingBillDate": "23-12-2021",
        "exportDuty": 10.0
    },
    "additionalDiscounts": [
        {
            "reason": "Festival Coupon CHRS",
            "amount": 5.0
        }
    ],
    "additionalCharges": [
        {
            "reason": "Packing",
            "amount": 5.0
        }
    ],
    "paymentInstrumentDetailsAndTerms": {
        "accountName": "ClearTax",
        "ifscCode": "SBIN11000",
        "accountNumber": "5697389713210",
        "upiId": "cleartax@ybl",
        "paymentTerms": "Cash payments not accepted",
        "paymentInstruction": "",
        "creditDays": 100,
        "creditTransferTerms": "1% credit card charge",
        "directDebitTerms": ""
    },
    "paymentReceivedDetails": [
        {
            "payerName": "ABCDE",
            "paymentMode": "Cash",
            "paidAmount": 100
        }
    ],
    "metadata": {
        "notes": "",
        "signatureImage": "",
        "printTemplateId": "3f27cfb5-d7d8-44cd-a323-7e36f02e54cb"
    },
    "referenceDocuments": {
        "linkedDocumentsDetails": [
            {
                "documentNumber": "INV22",
                "documentDate": "11-12-2021",
                "documentType": "INV"
            },
            {
                "documentNumber": "INV23",
                "documentDate": "11-12-2021",
                "documentType": "INV"
            }
        ],
        "orderReferenceDetails": [
            {
                "receiptAdviceNo": "Doc/003",
                "receiptAdviceDate": "01-08-2020",
                "batchReferenceNo": "Abc001",
                "contractReferenceNo": "Co123",
                "otherReferenceNo": "Yo456",
                "projectReferenceNo": "Doc-456",
                "poReferenceNo": "Doc-789",
                "poReferenceDate": "01-08-2020"
            }
        ]
    },
    "additionalDocumentDetails": [
        {
            "id": "1",
            "attachmentType": "URL",
            "value": "https://einv-apisandbox.nic.in",
            "description": "Document Test"
        },
        {
            "id": "2",
            "attachmentType": "DOCUMENT",
            "value": "base64 of the document",
            "description": "Document Test"
        }
    ],
    "lineItems": [
        {
            "serialNumber": 1,
            "name": "Biscuit",
            "description": "Snacks",
            "isService": false,
            "hsnCode": "19053100",
            "skuCode": "S0222",
            "taxRate": 5.0,
            "pricePerUnit": 100.0,
            "discountPerUnit": null,
            "taxableAmount": 200.0,
            "cessRate": null,
            "stateCessRate": null,
            "cessNonAdvolAmount": null,
            "stateCessNonAdvolAmount": null,
            "quantity": 2,
            "unitOfMeasurement": "PAC",
            "otherCharges": null,
            "taxCategory": null,
            "customFields": [
                {
                    "name": "flavour",
                    "value": "vanilla"
                }
            ],
            "discount": null,
            "igstAmount": 10.0,
            "cgstAmount": null,
            "sgstAmount": null,
            "cessAmount": null,
            "stateCessAmount": null,
            "grossAmount": 200.0,
            "totalItemValue": 210.0
        }
    ],
    "valueDetails": {
        "totalTaxableAmount": 200.0,
        "totalCgstAmount": null,
        "totalIgstAmount": 10.0,
        "totalSgstAmount": null,
        "totalCessAmount": null,
        "totalStateCessAmount": null,
        "totalDiscountAmount": 5.0,
        "totalAdditionalChargeAmount": 5.0,
        "totalRoundOffAmount": null,
        "totalAmount": 210.0,
        "totalTaxAmount": 10.0,
        "totalAmountInForeignCurrency": null
    }
}

Sample Response

{
    "documentId": "65e58dfa9ff80d1609f1b66f",
    "documentNumber": "ALLBD-3",
    "documentType": "DBN",
    "documentTimestamp": "08-02-2024 00:00:00",
    "documentDownloadUrl": "/v1/invoice/65e58dfa9ff80d1609f1b66f/download",
    "documentValueDetails": {
        "totalTaxableAmount": 75.00,
        "totalCgstAmount": 0.00,
        "totalIgstAmount": 0.00,
        "totalSgstAmount": 0.00,
        "totalCessAmount": 0.00,
        "totalStateCessAmount": 0.00,
        "totalDiscountAmount": 0.00,
        "totalAdditionalChargeAmount": 0.00,
        "totalRoundOffAmount": 0.00,
        "totalAmount": 75.00,
        "totalTaxAmount": 0.00,
        "totalAmountInForeignCurrency": 0.00,
        "totalCessNonAdVolAmount": null,
        "totalCgstItcValue": null,
        "totalSgstItcValue": null,
        "totalIgstItcValue": null,
        "totalCessItcValue": null
    },
    "errorDetails": null
}
{
 "errorDetails": [
 {
    "errorCode": "6002",
    "errorMessage": "Invalid value for the field
   documentDetails.supplyType. Send the correct the value and try again",
    "errorSource": "CLEARTAX",
    "path": "documentDetails.supplyType"
  }
 ]
}

Last updated