Get E-Invoice PDF

Fetch the e-invoice PDF using the invoice identifiers associated with the invoice data previously transmitted to Clear

Request Method

GET

Request URL

{{HOST}}/einvoice/v1/documents/print

Request Headers

Parameter
Data Type
Field Validations
Description

x-cleartax-auth-token

String

Cannot be empty

Mandatory.

User auth token.

x-clear-vat

String

Cannot be empty

Mandatory.

VAT of the entity

x-clear-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 TIN of the entity.

x-clear-country-code

String

Cannot be empty

Mandatory.

Country Code.

x-request-id

UUID

Should be unique for every request

Optional.

Unique request ID.

Request Path Params

There are no path params for this API.

Request Query Params

Parameter
Data Type
Field Validations
Description

document-id

String

NA

Conditional.

Required if these fields are not provided- document-number, document-date, document-type, taxpayer-identifier

template-id

String

NA

Optional.

Default is โ€œ2โ€ (Standard Invoice Template).

Contact your CSM for Custom Print Templates.

einvoice-type

ENUM

SALES, PURCHASE

Optional.

Default: SALES, if key not passed.

document-number

String

NA

Conditional.

Document Number of Invoice.

Required if document-id is not provided.

document-date

String

yyyy-mm-dd

Conditional.

Document Date of Invoice.

Required if document-id is not provided.

document-type

ENUM

REQUEST_FOR_PAYMENT

DEBIT_NOTE_GOODS_OR_SERVICES

METERED_SERVICES_INVOICE

DEBIT_NOTE_FINANCIAL_ADJUSTMENTS

TAX_NOTIFICATION

FINAL_PAYMENT_REQUEST

PAYMENT_REQUEST_COMPLETED_UNITS

COMMERCIAL_INVOICE_PACKING_LIST

COMMERCIAL_INVOICE

COMMISSION_NOTE

DEBIT_NOTE

PREPAYMENT_INVOICE

TAX_INVOICE

FACTORED_INVOICE

CONSIGNMENT_INVOICE

FORWARDERS_INVOICE_DISCREPANCY

INSURERS_INVOICE

FORWARDERS_INVOICE

FREIGHT_INVOICE

CLAIM_NOTIFICATION

CONSULAR_INVOICE

PARTIAL_CONSTRUCTION_INVOICE

PARTIAL_FINAL_CONSTRUCTION_INVOICE

FINAL_CONSTRUCTION_INVOICE

CREDIT_NOTE_GOODS_OR_SERVICES

CREDIT_NOTE_FINANCIAL_ADJUSTMENTS

CREDIT_NOTE

FACTORED_CREDIT_NOTE

FORWARDERS_CREDIT_NOTE

Conditional.

Document Type of Invoice.

Required if document-id is not provided.

taxpayer-identifier

String

NA

Conditional.

Issuer VAT.

Required if document-id is not provided.

Request Body

There is no request body for this API.

Response Status Codes

HTTP Status Code
Description

200

For successfully printed

400

For any cleartax validation error

401

If the user is not authenticated for the operation

403

If the user is not authorized for the operation

404

If data is not present

5XX

Unhandled exception

Response Schema

The response will be a PDF file for a successful scenario. In case of an error, the error response will be an array of error details objects.

Sample Request & Response

Request

There is no request body for this API.

Response (Success)

HTTP Status Code: 200 OK

PDF File containing Invoice Data.

Response (Error)

HTTP Status Code 404

API Validations

  1. The Document Id should be valid and the invoice data for this document must be present in Clear.

API Constraints

  1. This API needs to be authenticated with a valid user authentication token. If the auth token is not present or is invalid, the API will return HTTP Status Code 401.

  2. If the auth token is valid, but the user does not have the authorization to print E-Invoice, then the API will return HTTP Status Code 403.

  3. If data is not present in the cleartax then the API will return HTTP Status Code 404.

Last updated

Was this helpful?