# GST E-Invoice JSON Payload Generator for IRP Testing

> Source: https://netray.co/tools/gst-e-invoice-json-payload-generator-india
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Builds a sample e-invoice JSON with the main IRP blocks so developers can map ERP fields and test in the sandbox.

## Category

developer

## Erp

Any ERP

## Industry

Manufacturing

## Region

India

## Audience

- ERP developer
- Integration consultant
- Tax technology lead

## Tool

**Kind:** template

**Output:** code

**Language:** json

**Fields:**

#### Document type

**Key:** doc_type

**Type:** select

**Options:**

- INV
- CRN
- DBN

**Default:** INV

#### Document number

**Key:** doc_no

**Type:** text

**Default:** INV/26-27/00421

**Help:** Maximum 16 characters.

#### Document date (DD/MM/YYYY)

**Key:** doc_date

**Type:** text

**Default:** 20/10/2026

#### Supply type

**Key:** sup_type

**Type:** select

**Options:**

- B2B
- SEZWP
- SEZWOP
- EXPWP
- EXPWOP
- DEXP

**Default:** B2B

#### Seller GSTIN

**Key:** seller_gstin

**Type:** text

**Default:** 27AAAAA0000A1Z5

**Help:** Sample value only.

#### Seller legal name

**Key:** seller_name

**Type:** text

**Default:** Sample Precision Components Pvt Ltd

#### Seller pincode

**Key:** seller_pin

**Type:** text

**Default:** 411019

#### Seller state code

**Key:** seller_state

**Type:** text

**Default:** 27

#### Buyer GSTIN

**Key:** buyer_gstin

**Type:** text

**Default:** 29BBBBB1111B1Z6

**Help:** Sample value only.

#### Buyer legal name

**Key:** buyer_name

**Type:** text

**Default:** Sample Aerospace Systems Ltd

#### Buyer pincode

**Key:** buyer_pin

**Type:** text

**Default:** 560100

#### Buyer state code and place of supply

**Key:** buyer_state

**Type:** text

**Default:** 29

#### Item description

**Key:** item_desc

**Type:** text

**Default:** Machined aluminium housing

#### HSN code

**Key:** hsn

**Type:** text

**Default:** 88033000

#### Quantity

**Key:** qty

**Type:** number

**Default:** 100

#### Unit (UQC)

**Key:** unit

**Type:** text

**Default:** NOS

#### Unit price

**Key:** unit_price

**Type:** number

**Default:** 2500

#### Assessable value

**Key:** assess

**Type:** number

**Default:** 250000

**Help:** Quantity x unit price less discount.

#### GST rate

**Key:** gst_rate

**Type:** number

**Default:** 18

#### IGST amount

**Key:** igst

**Type:** number

**Default:** 45000

**Help:** Use 0 for intra-state and fill CGST and SGST instead.

#### CGST amount

**Key:** cgst

**Type:** number

**Default:** 0

#### SGST amount

**Key:** sgst

**Type:** number

**Default:** 0

#### Invoice total

**Key:** total

**Type:** number

**Default:** 295000

**Blocks:**

#### Sample e-invoice payload

**Body:** {
  "Version": "1.1",
  "TranDtls": {
    "TaxSch": "GST",
    "SupTyp": "{{sup_type}}",
    "RegRev": "N",
    "IgstOnIntra": "N"
  },
  "DocDtls": {
    "Typ": "{{doc_type}}",
    "No": "{{doc_no}}",
    "Dt": "{{doc_date}}"
  },
  "SellerDtls": {
    "Gstin": "{{seller_gstin}}",
    "LglNm": "{{seller_name}}",
    "Addr1": "Plant address line",
    "Loc": "Location",
    "Pin": {{seller_pin}},
    "Stcd": "{{seller_state}}"
  },
  "BuyerDtls": {
    "Gstin": "{{buyer_gstin}}",
    "LglNm": "{{buyer_name}}",
    "Pos": "{{buyer_state}}",
    "Addr1": "Buyer address line",
    "Loc": "Location",
    "Pin": {{buyer_pin}},
    "Stcd": "{{buyer_state}}"
  },
  "ItemList": [
    {
      "SlNo": "1",
      "PrdDesc": "{{item_desc}}",
      "IsServc": "N",
      "HsnCd": "{{hsn}}",
      "Qty": {{qty}},
      "Unit": "{{unit}}",
      "UnitPrice": {{unit_price}},
      "TotAmt": {{assess}},
      "Discount": 0,
      "AssAmt": {{assess}},
      "GstRt": {{gst_rate}},
      "IgstAmt": {{igst}},
      "CgstAmt": {{cgst}},
      "SgstAmt": {{sgst}},
      "TotItemVal": {{total}}
    }
  ],
  "ValDtls": {
    "AssVal": {{assess}},
    "CgstVal": {{cgst}},
    "SgstVal": {{sgst}},
    "IgstVal": {{igst}},
    "TotInvVal": {{total}}
  }
}

#### Mapping notes

**Body:** SellerDtls and BuyerDtls come from the company and customer masters. ItemList repeats once per invoice line. ValDtls must equal the sum of the line values within the rounding tolerance the IRP accepts. Add optional blocks (DispDtls, ShipDtls, PayDtls, RefDtls, EwbDtls) when your process needs them.

**Notes:** Starting point only. Field names, mandatory rules and schema versions are published by the GST e-invoice system and are updated periodically. Validate against the current schema and test in the IRP sandbox before production. Sample GSTINs are not real.

## Content

**Intro:** To report an invoice to the Invoice Registration Portal, your ERP sends a JSON file with seller, buyer, item and value blocks. This generator produces a clean skeleton that you can compare with your own connector output.

**Sections:**

#### How to use the generator

**Body:** Fill the fields with sample values from a real test invoice, or leave the defaults. The generated JSON follows the block structure used by the e-invoice schema: transaction details, document details, seller, buyer, item list and value details. Copy the output into a test file, validate it with the offline tool or the sandbox API, and use it as the reference when you map ERP tables to JSON keys. Change intra-state versus inter-state tax fields by moving amounts between IGST and CGST plus SGST.

#### How the payload is organised

**Body:** TranDtls carries the tax scheme, supply type and reverse charge flag. DocDtls holds the document type, number and date in DD/MM/YYYY format. SellerDtls and BuyerDtls hold GSTIN, legal name, address, pincode and state code, with Pos (place of supply) on the buyer side. ItemList holds one object per line with HSN, quantity, unit, price, assessable value, rate and tax amounts. ValDtls holds the invoice totals.

**Bullets:**

- Document number is limited to 16 characters
- Dates in the payload use DD/MM/YYYY
- HSN is mandatory at line level
- Totals in ValDtls must reconcile to item values

#### Common mistakes

**Body:** Developers frequently send amounts with too many decimals, mismatch ValDtls against the sum of items, or use the wrong state code for the buyer when the ship-to address differs. Another common error is formatting the date as ISO. A third is sending IGST for a supply that is intra-state because the place of supply was copied from the bill-to rather than the correct state. Keep a unit test that loads this skeleton, replaces values from a real invoice, and compares the totals.

#### ERP notes

**Body:** Map each JSON key to one source column and document it. For SAP, this usually means billing document header and item tables plus customer master fields. For Oracle, Infor and Dynamics, use the invoice header, lines and tax lines. Keep the mapping in a version-controlled sheet so changes to the schema can be tracked.

**Cta:** Netray can help build and test the ERP-to-IRP mapping, including the exceptions report for invoices that failed validation.

**Faq:**

#### Is this JSON valid for production use?

**Answer:** It is a skeleton for learning and testing. Mandatory fields, validations and schema versions are controlled by the GST e-invoice system and change over time. Validate with the offline tool or the sandbox before sending anything to production.

#### Which date format does the IRP expect?

**Answer:** The document date in the payload uses DD/MM/YYYY. Many ERPs store dates in ISO format, so add a conversion step in the integration instead of editing the output by hand.

#### How do I handle multiple lines?

**Answer:** Repeat the object inside ItemList once per invoice line, increment SlNo, and make sure ValDtls equals the sum of the line values. The IRP checks totals against the items within a small rounding tolerance.

#### Do CGST and SGST appear together?

**Answer:** Yes, for intra-state supplies you fill CgstAmt and SgstAmt with equal amounts and set IgstAmt to zero. For inter-state supplies you fill IgstAmt and leave the other two as zero. The place of supply decides which applies.

## Search terms

gst e-invoice json format, e-invoice json sample, irp json schema fields, e-invoice payload generator, einvoice api json example, gst e-invoice json erp mapping, e-invoice offline tool json, irn json structure

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
