# JSON

If you cannot provide an XML document as input you can provide the required document information via a JSON input. We have constructed a schema which supports the requirements to generate all the document types acceptable by ZATCA. We provide the following to test out JSON schema using the inputs you will be providing.

* [Redoc UI](https://qa-ksa-bk-pagero.mastersindia-einv.com/redoc#tag/Sample-JSON2UBL-API/operation/test_json_input_api_v1_test_json_input__post) to view each parameter of the JSON input in detail
* [Swagger UI](https://qa-ksa-bk-pagero.mastersindia-einv.com/docs#/Sample%20JSON2UBL%20API/test_json_input_api_v1_test_json_input__post) to test out the payload with the test API
* [Postman Collection](https://documenter.getpostman.com/view/14132696/2s946idXXZ) if you want to run via the postman app

Here are some samples for each document.

* [Standard Invoice](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Standard_Invoice.json)
* [Standard Debit Note](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Standard_Debit_note.json)
* [Standard Credit Note](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Standard_Credit_note.json)
* [Standard Prepayment](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Standard_PrePayment.json)
* [Standard Invoice with Prepayments](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Standard_Invoice_with_PrePayment.json)
* [Simplified Invoice](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Simplified_Invoice.json)
* [Simplified Debit Note](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Simplified_Debit_note.json)
* [Simplified Credit Note](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Simplified_Credit_note.json)
* [Simplified Prepayment](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Simplified_PrePayment.json)
* [Simplified Invoice with Prepayment](https://bmjft4cif2ly.compat.objectstorage.me-jeddah-1.oraclecloud.com/offline-utility/sample_invoices/json/Simplified_Invoice_with_PrePayment.json)

## Request Method

POST

## Request Path

```
{{API_URL}}/api/v2/ksa_einvoice/online_service/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

Refer to the sample documents for inputs

The response for the API can be found [here](https://masters-india-1.gitbook.io/ksa-e-invoicing-api/generate-einvoice-api/responses).
