When generating an Invoice Reference Number through an ERP connector or direct GSP integration, receiving an HTTP 400 response stops billing operations. The Invoice Registration Portal gateway issues HTTP 400 before checking business logic if the payload parser cannot parse the data stream into a valid JSON object.
Understanding the statutory schema under Rule 48(4)
Every taxpayer notified under Notification No. 13/2020-Central Tax (and subsequent notifications reducing the turnover threshold to ₹5 crore) must report outward supplies to registered persons under Rule 48(4) of the CGST Rules. Under Rule 48(5) of the CGST Rules, any invoice issued without obtaining an IRN is legally invalid.
The technical parameters for reporting are prescribed in Form GST INV-01, as notified in Notification No. 60/2020-Central Tax. The IRP API enforces strict type definitions, regex patterns, and string lengths across each nested block of the JSON document. If a single element violates structural rules, the parser aborts execution.
Common mistake: Attempting to retry an upload repeatedly without correcting JSON syntax causes repeated gateway rejections. Ensure that your ERP raw payload is verified locally prior to transmission.
Primary causes of HTTP 400 invalid JSON body
The error arises from structural defects in the request payload rather than tax rate errors. Review your JSON payload against three specific validation bottlenecks:
1. Disallowed characters and unescaped quotes
In standard JSON notation, double quotes delimiter string values. If an item description contains an unescaped inch symbol (such as 2" pipe) or unescaped backslashes, the JSON parser encounters an unexpected token. All internal quotes inside string fields must be escaped as \".
Similarly, invoice numbers must follow strict naming limits. Under Rule 46(b) of the CGST Rules, an invoice number can contain only alphabets, numerals, and special characters restricted to hyphen (-) and slash (/), with a maximum length of 16 characters. Passing symbols such as hash (#), space, or punctuation marks in the document number field will trigger payload validation failures.
2. String length limit violations
Form GST INV-01 defines explicit maximum string lengths. When address lines or item descriptions exceed schema bounds, the gateway drops the payload:
| JSON Field Path | Description | Max Length | Common Cause of Failure |
|---|---|---|---|
| DocDtls.No | Document Number | 16 characters | Spaces, hash signs, or series exceeding 16 digits |
| BuyerDtls.Addr1 | Buyer Building/Street | 100 characters | ERP concatenating full address into line 1 |
| BuyerDtls.Loc | Buyer City/Location | 50 characters | Adding district, state, and pin together |
| ItemList.PrdDesc | Product Description | 300 characters | Pasting long technical specifications or warranty notes |
3. Structural JSON defects
Formatting errors produced by custom accounting scripts or database export queries often cause immediate HTTP 400 rejections:
- Trailing commas: Placing a comma after the final object in the ItemList array or after the last key-value pair invalidates the JSON specification.
- Type mismatches: Passing numeric amounts as strings or boolean flags as numeric integers (for example passing 1 instead of true/false where boolean is required).
- Empty mandatory fields: Passing null instead of omitting an optional field, or leaving mandatory schema fields blank.
If you encounter recipient validation issues after fixing the JSON syntax, check whether the customer registration status is valid as covered in our guide on resolving recipient GSTIN inactive or cancelled status. If an invoice was registered earlier and an IRN was generated, attempting to upload it again will return error 2150, as detailed in our guide on e-invoice error 2150 duplicate IRN.
Step-by-step resolution process
- Extract the raw payload: Capture the exact JSON string generated by your accounting package before transmission to the IRP endpoint.
- Validate JSON syntax: Run the captured payload through a standard offline JSON validator to locate syntax breaks, unexpected tokens, or unescaped characters.
- Verify document types: Ensure the document type strictly matches the permitted codes in Form GST INV-01 (INV for Invoice, CRN for Credit Note, DBN for Debit Note) under Notification No. 60/2020-Central Tax.
- Sanitize product descriptions: Strip out special control characters, line breaks, carriage returns, and unescaped quotation marks from item descriptions and buyer addresses.
- Check invoice number characters: Confirm that the document number conforms to Rule 46(b) of the CGST Rules and does not exceed 16 characters.
Worked example: correcting an invalid JSON payload
A manufacturing firm, ABC Industrial Works, attempted to push an outward tax invoice for ₹1,18,000 to the IRP API. The request failed instantly with HTTP 400 Invalid JSON Body.
Upon reviewing the ERP payload log, two specific defects were identified: the item description contained unescaped quotes (5" Heavy Clamp), and the buyer address exceeded 100 characters because the ERP merged the street and locality into Addr1.
| Taxable Value | CGST (9%) | SGST (9%) | Total Invoice Value | Payload Status |
|---|---|---|---|---|
| ₹1,00,000 | ₹9,000 | ₹9,000 | ₹1,18,000 | HTTP 400 (Syntax break) |
| ₹1,00,000 | ₹9,000 | ₹9,000 | ₹1,18,000 | 200 OK (IRN generated) |
Formula for total invoice value calculation: Total Invoice Value = Taxable Value + CGST Amount + SGST Amount = ₹1,00,000 + ₹9,000 + ₹9,000 = ₹1,18,000.
The accountant corrected the item description to read 5-inch Heavy Clamp and split the buyer address across Addr1 and Addr2. Re-uploading the sanitized JSON generated the IRN successfully.
Frequently asked questions
Why does the e-invoice portal return HTTP error 400 invalid JSON body?
The Invoice Registration Portal returns HTTP 400 when the uploaded request payload violates syntax rules or the Form GST INV-01 technical schema. Common causes include unescaped quotes, trailing commas, invalid special characters in text fields, or field lengths exceeding official limits.
Which special characters are allowed in invoice numbers under GST?
Under Rule 46(b) of the CGST Rules, an invoice number must be a consecutive serial number not exceeding 16 characters, containing only alphabets, numerals, and special characters limited strictly to hyphen (-) and slash (/).
How does an unescaped character break JSON parsing in ERP systems?
In JSON structure, double quotes, unescaped backward slashes, and control characters terminate string literals prematurely. When the IRP API parser reads an unescaped double quote inside an address or item description field, it fails parsing before schema validation and rejects the payload with HTTP 400.
Check your purchase register against GSTR-2B
When your suppliers upload e-invoices, the data flows into your GSTR-2B automatically. Reconcile your purchase register against GSTR-2B in seconds with zero server uploads. Your GSTR-2B and purchase register files are read in your browser and never uploaded to any server.
Last checked: 21 October 2026. Sources: CBIC CGST Rules Rule 48, Notification No. 60/2020-Central Tax Form GST INV-01, Notification No. 13/2020-Central Tax.