> For the complete documentation index, see [llms.txt](https://masters-india-1.gitbook.io/ksa-e-invoicing-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://masters-india-1.gitbook.io/ksa-e-invoicing-api/get-invoice-in-pdf.md).

# Get Invoice in PDF

To generate the signed invoice in a PDF format you can use this API. This API converts the signed XML UBL2.1 compliant invoice into a Human Readable PDF format. The template of which is inspired from the ZATCA SDK.

## Request Method

GET

## Request Path

```
{{API_URL}}/api/v2/ksa_einvoice/online_service/get_invoice_in_pdf/
```

## Request Params

| Parameter     | Value                                | Description         |
| ------------- | ------------------------------------ | ------------------- |
| invoice\_id   | 1                                    | ID of the invoice   |
| invoice\_uuid | 63547e08-0c1b-11ee-be56-0242ac120002 | UUID of the invoice |

## Request Headers

<table><thead><tr><th>Parameter</th><th width="184">Value</th><th>Description</th></tr></thead><tbody><tr><td>Productid</td><td>einvoicing_global</td><td>Keep as is</td></tr><tr><td>Authorization/MiplApiKey</td><td>api_key/auth token</td><td>Value and header type is mentioned in the Authentication Page</td></tr></tbody></table>

## Responses

### 200 (OK)

Response will be a file of PDF format

### 404 (Not found)

If invoice is not found in the database

```json
{
    "message" : "Invoice Does not exist in the database"
    "success": false,
    "error_code": 1001,
    "data": {}
}
```

### 401 (Permission Error)

You will get 401 errors when the token is invalid.&#x20;

### 500 (Server Error)

If there is a server error during the invoice processing

```json
{
    "message": "Internal Server Error",
    "success": false,
    "error_code": 1001,
    "data": {}
}
```
