# Generate B2C Payment QR Code (Lite)

You can generate a QR code by sending a **`POST`** request to E-Invoicing API with the following request headers.

### Request Method

POST

### **Request URL**

```
{{HOST}}/einv/v1/qrcode/generate
```

### **Request Header**

| Parameter             | Data Type | Field Validations | Description                                                             |
| --------------------- | --------- | ----------------- | ----------------------------------------------------------------------- |
| X-Cleartax-Auth-Token | String    | NA                | Mandatory. The auth token generated from ClearTax user id and password. |
| Gstin                 | String    | NA                | Mandatory. GSTIN number for the user.                                   |
| Content-Type          | String    | NA                | <p>Mandatory. This will always be <br>"application/json" for JSON.</p>  |

### Request Path Params <a href="#request-path-params" id="request-path-params"></a>

There are no path parameters for this API.

### Request Query Params <a href="#request-query-params" id="request-query-params"></a>

There are no query parameters for this API.

### **Request Body**

| Parameter                    | Data Type | Field Validations                                                      | Description                                                                  |
| ---------------------------- | --------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| payee\_address               | String    | NA                                                                     | Mandatory. Payee VPA(Virtual Payment Address)                                |
| payee\_name                  | String    | <p>minLength: 1</p><p>maxLength: 100</p><p>pattern: "^([^\\\"])*$"</p> | Mandatory. Payee Name                                                        |
| transaction\_note            | String    | NA                                                                     | Optional. Transaction note providing a short description of the transaction. |
| transaction\_amount          | String    | NA                                                                     | Mandatory. Transaction amount in decimal format.                             |
| payee\_bank\_account\_number | String    | <p>minLength: 1</p><p>maxLength: 18</p><p>pattern: "^([^\\\"])*$"</p>  | Optional.  Payee bank account number                                         |
| payee\_ifsc\_code            | String    | <p>minLength: 1</p><p>maxLength: 11</p><p>pattern: "^([^\\\"])*$"</p>  | Optional.  Payee IFSC code                                                   |
| document\_number             | String    | NA                                                                     | Optional.  Document number                                                   |
| document\_date               | String    | NA                                                                     | Optional.  Document date                                                     |
| gstin                        | String    | 15 Characters                                                          | Optional. Seller GSTIN number                                                |
| gst\_value                   | String    | NA                                                                     | Optional. Total GST tax value                                                |
| cgst\_value                  | String    | NA                                                                     | Optional. CGST value                                                         |
| sgst\_value                  | String    | NA                                                                     | Optional. SGST value                                                         |
| igst\_value                  | String    | NA                                                                     | Optional. IGST value                                                         |
| cess\_value                  | String    | NA                                                                     | Optional. CESS value                                                         |

### Response Status Codes

| HTTP Status Code | Description                                                                  |
| ---------------- | ---------------------------------------------------------------------------- |
| 200              | For a successfully processed request (may be a success or validation error). |
| 401              | If the user is not authenticated for the operation.                          |
| 403              | If the user is not authorized for the operation.                             |
| 500              | If there are any unhandled exceptions on the Clear side.                     |

### Response Schema

| Parameter      | Data Type | Field Validations | Description                                                                     |
| -------------- | --------- | ----------------- | ------------------------------------------------------------------------------- |
| qr\_code       | String    | NA                | QR code string in base 64 format. Value will be null in negative case scenario. |
| raw\_qrCode    | String    | NA                | This field will contain the keys - values pair of request.                      |
| error\_details | List      | NA                | List of Error objects. Will be null in a successful API call.                   |

#### Error Details Object

| Parameter      | Data Type | Field Validations | Description                        |
| -------------- | --------- | ----------------- | ---------------------------------- |
| error\_code    | Number    | NA                | Specific code as per the error.    |
| error\_message | String    | NA                | Specific message as per the error. |
| error\_source  | String    | ClearTax          | Source of the error.               |

### Sample Request and Response <a href="#sample-request-and-response" id="sample-request-and-response"></a>

#### Request

```json
{
    "payee_name": "sandeepjayendran",
    "payee_address": "sandjay@okhdfcbank",
    "transaction_amount": "100.5",
    "transaction_note": "TransactionNote",
    "payee_bank_account_number": "123456789",
    "payee_ifsc_code": "HDFC12345",
    "document_number": "Doc123",
    "document_date": "23/03/2021",
    "gstin": "29AAFCD5862R000",
    "gst_value": "18",
    "cgst_value": "9",
    "sgst_value": "9",
    "igst_value": "0",
    "cess_value": "0"
}
```

#### Response (Success)&#x20;

**HTTP Status Code: 200 OK**

```json
{
    "qr_code": "iVBORw0KGgoAAAANSUhEUgAAAcIAAAHCAQAAAABUY/ToAAAHB0lEQVR4Xu2aTc7iTAyEjViw5Ai5CVwMiUi5WLhJjsAyC0RPPeUw0htGXz7NZhZOSxPlp6tfqcauLruJ9pdjjPWb/zt25NbYkVtjR26NHbk1duTW2JFbY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RbSfYJDckytzNtFP+FP2R2AeRIQjJ1tlkAHpDpmGuEpeyo7VSsq+UiyL8YO3Jr7MitsSO3xo7cGjtya+zIrbEjt8aO3Br/BPkL0XSwqOHhDjEAAAAASUVORK5CYII=",
    "raw_qrCode": "upi://pay?pa=sandjay@okhdfcbank&pn=7843842529@paytm&tn=Transaction Note - TransactionNote, Supplier Name - 7843842529@paytm, Supplier GSTIN - 29AAFCD5862R000, Bank Account Number - 123456789, UPI ID - sandjay@okhdfcbank, IFSC Code - HDFC12345, Invoice Number - Doc123, Invoice Date - 23/12/2022, Transaction Amount - 1000, GST Amount - 18, CGST Amount - 9, SGST Amount - 9, IGST Amount - 0, CESS Amount - 0&am=1000&cu=INR&mode=01",
    "error_details": null
}
```

#### Response (Success)&#x20;

**HTTP Status Code: 200 OK**

```json
{
    "qr_code": null,
    "raw_qrCode": null,
    "error_details": {
        "error_code": "107",
        "error_message": "null : UPI Id can not be left blank",
        "error_source": "CLEARTAX"
    }
}
```

When you scan the QR Code generated using the API returned qr\_code string, the payload corresponds to:

```
upi://pay?pa=vatsan@okhdfcbank&pn=sandeep%20jayendran&tn=Transaction+Note%3A+TransactionNote%2C+Supplier+GSTIN%3A+29AAFCD5862R000%2C+Bank+Account+Number%3A+123456789%2C+IFSC+Code%3A+HDFC12345%2C+Invoice+Number%3A+Doc123%2C+Invoice+Date%3A+23%2F03%2F2021%2C+GST+Amount%3A+18%2C+CGST+Amount%3A+9%2C+SGST+Amount%3A+9%2C+IGST+Amount%3A+0%2C+CESS+Amount%3A+0&am=100.5&cu=INR&mode=01
```

### API Validations <a href="#api-validations" id="api-validations"></a>

Currently there are no known validations for this API.

### API Constraints <a href="#api-constraints" id="api-constraints"></a>

Payee UPI Id is mandatory to generate B2C QR Code.
