> For the complete documentation index, see [llms.txt](https://docs.cleartax.in/cleartax-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cleartax.in/cleartax-docs/e-invoicing-api/e-invoicing-api-reference/rcm-self-invoicing-purchase-documents-clear-schema/generate-irn.md).

# Generate IRN

Note:The request body schema is unchanged; for a self-invoice, set SupTyp to RCMDOM / RCMIMP, RegRev to Y and SellerDtls.Gstin to URP. Including EwbDtls still generates the e-way bill in the same call

### Request Method

#### **PUT**

### Request URL

```json
{{HOST}}/einv/v2/eInvoice/generate
```

### Request Headers

<table><thead><tr><th width="191">Parameter</th><th width="146">Data Type</th><th width="163">Field Validations</th><th>Description</th></tr></thead><tbody><tr><td>X-Cleartax-Auth-Token</td><td>String</td><td>NA</td><td>Mandatory. The auth token generated from ClearTax user id and password.</td></tr><tr><td>Content-Type</td><td>String</td><td>NA</td><td>Mandatory. This will always be <br>"application/json" for JSON </td></tr><tr><td>gstin</td><td>String</td><td>NA</td><td>Mandatory. GSTIN number for the user</td></tr></tbody></table>

### Sample Request and Response for RCMDOM use case:

#### Request

```json
 [
  {
    "transaction": {
      "Version": "1.1",
      "TranDtls": {
        "TaxSch": "GST",
        "SupTyp": "RCMDOM",
        "RegRev": "Y",
        "IgstOnIntra": "N"
      },
      "DocDtls": {
        "Typ": "INV",
        "No": "SI/2026/001",
        "Dt": "02/01/2027"
      },
      "SellerDtls": {
        "Gstin": "URP",
        "LglNm": "ABC Traders",
        "Addr1": "12, MG Road",
        "Loc": "BENGALURU",
        "Pin": 560001,
        "Stcd": "29"
      },
      "BuyerDtls": {
        "Gstin": "29AWGPV7107B1Z1",
        "LglNm": "XYZ Company Pvt Ltd",
        "TrdNm": "XYZ Industries",
        "Pos": "29",
        "Addr1": "7th block, kuvempu layout",
        "Loc": "BENGALURU",
        "Pin": 562160,
        "Stcd": "29"
      },
      "ItemList": [
        {
          "SlNo": "1",
          "PrdDesc": "Rice",
          "IsServc": "N",
          "HsnCd": "10019920",
          "Qty": 10,
          "Unit": "BAG",
          "UnitPrice": 1000,
          "TotAmt": 10000,
          "AssAmt": 10000,
          "GstRt": 5,
          "IgstAmt": 0,
          "CgstAmt": 250,
          "SgstAmt": 250,
          "TotItemVal": 10500,
          "OrgCntry": "IN"
        }
      ],
      "ValDtls": {
        "AssVal": 10000,
        "CgstVal": 250,
        "SgstVal": 250,
        "IgstVal": 0,
        "TotInvVal": 10500
      }
    }
  }
]

```

#### &#x20;Response - **Success:**

```json
[
  {
    "custom_fields": null,
    "deleted": false,
    "document_status": "IRN_GENERATED",
    "error_response": null,
    "errors": null,
    "govt_response": {
      "Success": "Y",
      "AckNo": 112310153714784,
      "AckDt": "2027-01-02 13:38:00",
      "Irn": "94b6c41efd740424c469908d0927db66d8f24d9dad78b02dab04ad1659813dc9",
      "SignedInvoice": "eyJhbGciOiJSUzI1NiIsImt......",
      "SignedQRCode": "eyJhbGciOiJSUzI1NiIsImt......",
      "Status": "ACT"
    },
    "group_id": null,
    "gstin": "29AWGPV7107B1Z1",
    "is_deleted": false,
    "owner_id": null,
    "tag_identifier": null,
    "transaction": { ... },          // echo of the request transaction
    "transaction_id": "29AWGPV7107B1Z1_SI/2026/001_INV_2026",
    "transaction_metadata": null
  }
]

```
