> 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/generate-einvoice-api/ubl2.1-xml-vat-in-url.md).

# UBL2.1 XML (VAT IN URL)

We accept the UBL2.1 XML compliant directly as the input for the generate einvoice API. The xml input needs to be base64 encoded. Here are some attached documents for your reference

* [Standard Invoice](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices_wo_supplier/xml/Standard_Invoice.xml)
* [Standard Credit Note](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices_wo_supplier/xml/Standard_Credit_Note.xml)
* [Standard Debit Note](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices_wo_supplier/xml/Standard_Debit_Note.xml)
* [Simplified Invoice](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices_wo_supplier/xml/Simplified_Invoice.xml)
* [Simplified Credit Note](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices_wo_supplier/xml/Simplified_Credit_Note.xml)
* [Simplified Debit Note](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices_wo_supplier/xml/Simplified_Debit_Note.xml)

As part of our responsibilities we will enrich the following elements within the document before sending it to ZATCA

* ProfileID
* UUID
* IssueDate
* IssueTime
* Previous Invoice Hash
* Invoice Counter Value
* Signature (Simplified Document Only)
* QR Code (Simplified Document Only)
* UBL Extensions (Simplified Document Only)

If you want to do a quick test without registering your company within our website you can try out the following [ENV](https://dev-ksa-bk-pagero.mastersindia-einv.com/docs#/Sample%20JSON2UBL%20API/test_ubl_input_api_v1_test_ubl_input__post). Basic test can be done here to see if your document is compliant or not.

## Request Method

POST

## Request Path

```
{{API_URL}}/api/v2/ksa_einvoice/<VAT_NUM>/generate_einvoice/
```

**NOTE:** VAT\_NUM is the vat number of your organization that you have onboarded in our website. For eg if you have onboarded vat number 399975588700003 then the full path would be&#x20;

```
{{API_URL}}/api/v2/ksa_einvoice/online_service/399975588700003/generate_einvoice/
```

## 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>

## Request Body

| Parameter | Value | Description                 |
| --------- | ----- | --------------------------- |
| invoice   | ""    | Base64 Encoded XML document |

The response for the API can be found [here](/ksa-e-invoicing-api/generate-einvoice-api/responses.md).
