# Generate PDF/A3 e-Invoice

### Request Method

POST

### Request URL

```
{{BASE_URL}}/api/EInvoice/GeneratePDFA3Base64
```

{% hint style="info" %}
Replace the `{{BASE_URL}}` with the one mentioned [here](/e-invoicing-ksa-api.md) based on whether you are using sandbox or production.

Replace the {Your\_Invoice\_Number} with Invoice Number.
{% endhint %}

### **Request Authorization**

| Parameter    | Data Type | Validations and Example | Description |
| ------------ | --------- | ----------------------- | ----------- |
| Bearer token | String    | Cannot be empty.        | Mandatory   |

### Request Body

<table><thead><tr><th>Parameter</th><th>Data Type</th><th width="117">Validations and Example</th><th>Description</th></tr></thead><tbody><tr><td>PDFBase64</td><td>String</td><td></td><td>Mandatory. Base64 of PDF</td></tr><tr><td>XMLBase64</td><td>string</td><td></td><td>Mandatory. Base64 of invoiceXML</td></tr></tbody></table>

### Sample Request

```json
{
    "PDFBase64": "JVBERi0xLjMNCjEgMCBvYmoN...",
    "XMLBase64": "PD94bWwgdmVyc2lvbj0iMS4w..."
}
```

### Response Status Codes

| HTTP Status Code | Description                                                                  |
| ---------------- | ---------------------------------------------------------------------------- |
| 200              | For a successful A3 PDF E-Invoice.                                           |
| 400              | For any kind of validation issues or invalid Invoice Number.                 |
| 401              | If the user is not authenticated for the operation.                          |
| 403              | If the user is not authorized for the operation.                             |
| 500              | HTTP Internal Server Error. Returned when the service faces internal errors. |

### Response Schema

| Parameter            | Data Type | Description |
| -------------------- | --------- | ----------- |
| base64EncodedPdfFile | String    | Mandatory   |

### Sample Response

Success - HTTP Status Code - 200

```json
{
    "base64EncodedPdfFile": "JVBERi0xLjcKJeLjz9MKOSAwIG9i..."
}
```

Error - HTTP Status Code - 400

```json
{
    "errorCode": "00400",
    "errorMessage": "PDFBase64 and XMLBase64 is Required",
    "errorSource": "EVS_Engine"
}
```


---

# 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://zatcaportalapidocs.evinciblesolutions.com/reference/api-reference-version-ii/generate-pdf-a3-e-invoice.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.
