# Get E-Invoice PDF

Get the PDF version of an E-Invoice based on the invoice identifiers of the invoice data already sent 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-tin           | String    | Cannot be empty                                | Mandatory. TIN 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-request-id          | UUID      | Should be unique for every request             | Optional. Unique request ID.                                                                    |

### Request Path Params

There are no path paramaters for this API.

### Request Query Params

| Parameter       | Data Type | Field Validations                                                                                                                                                | Description                                                                                                                     |
| --------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| document-id     | String    | NA                                                                                                                                                               | Mandatory. If other Document Details are not specified                                                                          |
| template-id     | String    | NA                                                                                                                                                               | Optional. Default is “39” (Standard Invoice Template). To know the print template ID, refer to “How to get print template ID?”. |
| einvoice-type   | ENUM      | SALES, PURCHASE, SALES\_B2C                                                                                                                                      | Default: SALES                                                                                                                  |
| document-number | String    | NA                                                                                                                                                               | Document Number of Invoice                                                                                                      |
| document-date   | String    | yyyy-mm-dd                                                                                                                                                       | Document Date                                                                                                                   |
| document-type   | String    | Enum: INVOICE, CREDIT\_NOTE, DEBIT\_NOTE, REFUND\_NOTE, SELF\_BILLED\_INVOICE, SELF\_BILLED\_CREDIT\_NOTE, SELF\_BILLED\_DEBIT\_NOTE, SELF\_BILLED\_REFUND\_NOTE | Document Type                                                                                                                   |
| tin             | String    | NA                                                                                                                                                               | Issuer TIN.                                                                                                                     |

{% hint style="success" %}
If using Custom Print Templates by CT, reach out to your CSM for Print Template Id.
{% endhint %}

### Request Body

There will be no request body for this API.

### Sample Request

Request URL

```json
https://api-sandbox.my.cleartax.com/einvoice/v1/documents/print?document-id=665f28c2f626dc2cac32abea
```

### 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                             |
| 429              | Too many requests                                  |
| 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 Response (Success)

HTTP Status Code

200

Response Body

```json
<filename>.pdf
```

### Sample Response (Error)

HTTP Status Code 404

Response Body

```json
{
    "ErrorDetails": [
        {
            "ErrorCode": "EINV-DOC-NF-001",
            "ErrorMessage": "You don't have any data present for the selected Document Details",
            "ErrorSource": "CLEARTAX"
        }
    ]
}
```

### 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. 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.
3. 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.&#x20;
4. If data is not present in the Clear then the API will return HTTP Status Code 404.&#x20;
5. Rate Limit: The below rate limits are in line with those applied by LHDN.&#x20;

   **Production - 300 API calls per minute with a burst capacity of 25 API calls**

   **Sandbox - 300 API calls per minute with a burst capacity of 25 API calls**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cleartax.in/cleartax-docs/e-invoicing-malaysia-api/e-invoicing-malaysia-api-reference/api-lists/get-e-invoice-pdf.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
