> 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.md).

# Generate Einvoice API

This page showcases how to generate einvoices with the 2 input format that we provide.

**NOTE**: This API expects the user to pass the seller address information as part of input payload. Incase you want us to add the information registered in our server during the onboarding you can follow the page with the input type indicated with "VAT IN URL".&#x20;

The E-invoice endpoint is **async** in fashion i.e you will not get the fully generated invoice in the API response. Once the invoice is passed to us, we will add the document in our worker queue and process then via consumer threads. The reason to do this in a such a way is because of the ZATCA governance mandate to ensure no duplicate ICV and PIH are to be present. In order to obtain the signed invoice you will need to either poll the "Get Invoice Process Status" API or register a callback URL in our system through which we will send the invoice back to your system.

The process of registering a callback is a manual process where you have to contact use and provide the following information

* Domain Name
* Headers to be used (authentication, content-type)
* Suggested API timeout

The response format of the callback API is mentioned in the [Responses](/ksa-e-invoicing-api/generate-einvoice-api/responses.md) section.

{% content-ref url="/pages/AvqAp8Fl5I7agCd37iaD" %}
[UBL2.1 XML](/ksa-e-invoicing-api/generate-einvoice-api/ubl2.1-xml.md)
{% endcontent-ref %}

{% content-ref url="/pages/7Hqv80PSp6WxXdYlcNcy" %}
[UBL2.1 XML (VAT IN URL)](/ksa-e-invoicing-api/generate-einvoice-api/ubl2.1-xml-vat-in-url.md)
{% endcontent-ref %}

{% content-ref url="/pages/md8TXeZLz0h9CdRFgS9Q" %}
[JSON](/ksa-e-invoicing-api/generate-einvoice-api/json.md)
{% endcontent-ref %}

{% content-ref url="/pages/CTwvempAVmeDTZuLJe7S" %}
[JSON (VAT IN URL)](/ksa-e-invoicing-api/generate-einvoice-api/json-vat-in-url.md)
{% endcontent-ref %}

{% content-ref url="/pages/SBI6qhzrt8JMrwHSzups" %}
[Responses](/ksa-e-invoicing-api/generate-einvoice-api/responses.md)
{% endcontent-ref %}

{% embed url="<https://www.mastersindia.co/contact-us/?products=KSA%20E-Invoice%20APIs>" %}
