GSTNexa

Annual returns: GSTR-9, 9A and 9C

integration guide

A working guide to the three annual-return flows, for a CRM or billing system calling the GST APIs. Authenticate, pull what the portal computed, let the user reconcile, save, check the save status, then sign and file for an ARN.

All GST return guides

Overview

Three flows, one shape. GSTR-9 is the annual return for regular taxpayers, GSTR-9A the composition equivalent, and GSTR-9C the reconciliation that can only start once GSTR-9 for the same GSTIN and year is filed. Each follows the same pattern: authenticate, pull the system-computed data, let the user review and edit, save, check the save status, then sign and file.

ReturnWho files Must be filed firstThe rule for your CRM
GSTR-9 Regular taxpayers All GSTR-1/1A and GSTR-3B of the FY Optional when aggregate turnover is up to ₹2 crore — warn, do not block.
GSTR-9A Composition taxpayers All quarterly returns of the FY Legacy years only. From FY 2019-20 composition dealers file GSTR-4 annual instead, so gate this flow by financial year.
GSTR-9C Regular taxpayers above ₹5 crore GSTR-9 of the same FY, with an ARN Self-certified reconciliation. Enable the module only once GSTR-9 shows Filed.

Before you code the parsers

Paths, methods and parameters below come from the Postman collection and the OpenAPI document. Both list only placeholder 404 and 500 responses, so capture the success responses from one sandbox run and build your parsers from those.

API inventory

Twenty endpoints across the three forms, plus three that are shared. Each form has two filing endpoints and the user picks one: retfile for DSC, retevcfile for EVC. There is no separate Proceed to File call — the summary with its chksum is what gets signed and filed.

#EndpointMethod PathKey inputsPurpose
1 Get GSTR9 Auto Calculated Details GET /gstr9/getautocal gstin, retperiod System-computed values from GSTR-1/1A and GSTR-3B
2 Create 8A Data PUT /gstr9/create8adetails body {gstin, fy} Asks GSTN to generate Table 8A (ITC as per GSTR-2B)
3 Get GSTR9 8A Details GET /gstr9/get8adetails gstin, fy, token, docid, retperiod The invoices and notes behind Table 8A
4 Get R1R1A HSN Details GET /gstr9/getHsndetails gstin, fy, retperiod HSN summary from GSTR-1 and 1A, for Table 17
5 Get GSTR9 Details GET /gstr9/getdet gstin, retperiod Saved data — its summary and chksum are what you file
6 Save GSTR9 PUT /gstr9/retsave body {gstin, fp, table4 …} Saves the return, returns a reference id
7 File GSTR9 POST /gstr9/retfile body {content, pkcs7} File with DSC
8 File GSTR9 data POST /gstr9/retevcfile pan, evcotp; body = summary File with EVC
9 Get GSTR9A Auto Calculated Details GET /gstr9a/getautocal gstin, retperiod System-computed values from composition returns
10 Get GSTR9A Details GET /gstr9a/getdet gstin, retperiod Saved GSTR-9A data and summary
11 Save GSTR9A PUT /gstr9a/retsave body {gstin, fp, table5 …} Saves GSTR-9A, returns a reference id
12 File GSTR9A POST /gstr9a/retfile body = signed summary File GSTR-9A with DSC
13 File GSTR9A data POST /gstr9a/retevcfile pan, evcotp; body = summary File GSTR-9A with EVC
14 Get 9 Records for GSTR9C GET /gstr9c/getrecds gstin, retperiod Filed GSTR-9 figures, to prefill 9C
15 Save GSTR9C PUT /gstr9c/retsave body {gstr9cdata: {audited_data …}} Saves the reconciliation
16 Get GSTR9C Summary GET /gstr9c/retsum gstin, retperiod Saved 9C summary, for review
17 Generate Certificate PUT /gstr9c/gencert body {gstin, fp, isauditor, cert_data} Builds the certificate, auditor or self-certified
18 Hash Generator PUT /gstr9c/genhash body = full gstr9cdata Hash of the 9C data, to be signed with DSC
19 File GSTR9C POST /gstr9c/retfile body {content, pkcs7} File GSTR-9C with DSC
20 File GSTR9C data POST /gstr9c/retevcfile pan, evcotp; body = summary File GSTR-9C with EVC
— Initiate OTP for EVC GET /authentication/otpforevc gstin, pan, form_type Sends the EVC OTP before an EVC filing
— Get Return Status GET /gstr/retstatus gstin, returnperiod, refid Status of a save, by reference id
— View and Track Returns GET /gstr/rettrack gstin, returnperiod, type Pre-check of earlier returns; confirms a filing

Prerequisites

No return API works without a live taxpayer session, so every flow starts with authentication and a pre-check of the year's earlier returns.

  1. 1 Taxpayer enables API access On the GST portal: My Profile → Manage API Access, choosing a session duration.
  2. 2 Request the OTP GET /authentication/otprequest?email= with headers gst_username, state_cd, ip_address, client_id, client_secret. The portal sends an OTP to the registered mobile and email.
  3. 3 Exchange it for a token GET /authentication/authtoken?email=&otp= with the same headers plus txn. The sandbox OTP is 575757. Later calls send no auth-token header, so the provider appears to hold the session against email + gst_username — confirm that and the txn rule in the sandbox.
  4. 4 Keep it alive GET /authentication/refreshtoken before expiry. If the refresh fails, go back and request a new OTP. Never retry a filing call on an expired session. GET /authentication/logout ends it.
  5. 5 Pre-check the year GET /gstr/rettrack?gstin=&returnperiod=&type= for every GSTR-1 and GSTR-3B of the FY, or the composition returns for 9A. If any period is pending, block GSTR-9 and list what is missing.

Common request headers

WhereNameValue
Header — every call client_id, client_secret Your API credentials
Header — every call gst_username The taxpayer's GST portal username
Header — every call state_cd First two digits of the GSTIN
Header — every call ip_address The end user's IP
Header — all but OTP request txn Transaction id
Header — PUT and POST gstin, ret_period GSTIN and 03YYYY — 032025 for FY 2024-25
Query — every call email The developer email registered with the provider
Query — GET gstin, retperiod The same values, as query parameters
Query — 8A and HSN fy YYYY-YY, e.g. 2024-25

The one that catches everyone: GET calls carry the period in the query string as retperiod, while PUT and POST carry it as a header named ret_period.

What to store

TableKey fields
gst_sessions gstin, username, auth_token, sek, expiry
annual_returns id, gstin, fy, form (9 / 9A / 9C), status, arn, filed_at, late_fee
annual_return_payloads return_id, source (autocalc / 8A / hsn / user), json, created_at
annual_return_calls return_id, api, txn, request, response, ref_id, status_cd, error_cd, created_at

Keep the raw response of every call in annual_return_calls. Support disputes and GSTN error tickets always ask for the txn id and the response.

GSTR-9 lifecycle

A fixed sequence with two loops — polling while 8A generates, and re-saving until the status is P — and a fork at the end between DSC and EVC.

The GSTR-9 lifecycle 12 steps Steps 3 and 4 have nothing to do with each other and can run at the same time.
1 · 2 Session + pre-check authtoken · rettrack 3 Auto-calculated gstr9/getautocal 4 Ask for 8A gstr9/create8adetails 5 Read 8A gstr9/get8adetails not ready — poll again 6 HSN summary gstr9/getHsndetails 7 Merge + validate your CRM 8 Save gstr9/retsave 9 Save status gstr/retstatus PE / ER — fix the tables and save again 10 Final summary gstr9/getdet · chksum 11 Pick a signature DSC · or otpforevc P — processed 12 · DSC File with the signature gstr9/retfile · content+pkcs7 12 · EVC File with the OTP gstr9/retevcfile · pan+evcotp ARN Filed — 9C unlocked store the ARN, set FILED

Read it in a snake: left to right along the top, then right to left along the second row. The dashed returns are the two loops — polling while the portal generates 8A, and saving again after a PE or ER status. Never call a filing endpoint while the latest save is not P.

  1. 1 Open a session Follow the prerequisites below: OTP, auth token, and keep the txn.
  2. 2 Pre-check the year /gstr/rettrack Every GSTR-1/1A and GSTR-3B of the FY must be filed. Any period pending — set BLOCKED_PREREQ, list the missing periods and stop.
  3. 3 Pull the auto-calculated figures GET /gstr9/getautocal Store the table-wise JSON with source autocalc. If the portal says the data is not ready, retry with back-off — do not loop tightly.
  4. 4 Ask for Table 8A PUT /gstr9/create8adetails Body {"gstin": "…", "fy": "2024-25"}. Keep the token from the response.
  5. 5 Read Table 8A, polling GET /gstr9/get8adetails Not ready — wait and poll again, with a cap on attempts and "8A still generating" in the UI. Ready — read the invoices and notes; docid looks like a page key, so loop until no documents remain. Sum into Table 8A and keep the list for drill-down.
  6. 6 Pull the HSN summary GET /gstr9/getHsndetails Prefills Table 17. Table 18, inward HSN, stays user input.
  7. 7 Merge and validate GET /gstr9/getdet Join autocalc, 8A and HSN into one form. If a draft already exists on the portal, read it first and let the user choose which version to keep. Check: amounts to two decimals, no negative tax, table totals tie, and flag Table 8D (8A minus 8B) when it is large.
  8. 8 Save PUT /gstr9/retsave Headers gstin and ret_period; body {"gstin", "fp": "032025", "table4": {…}}. Store the reference id, set SAVE_SUBMITTED.
  9. 9 Poll the save status GET /gstr/retstatus P — saved, go on. PE or ER — show the error report against each table and go back to step 7. IP or REC — poll again after a delay.
  10. 10 Read the final summary GET /gstr9/getdet Show it with the late fee and store the chksum. If the late fee is above zero, make sure the cash ledger covers it before filing.
  11. 11 Pick a signature GET /authentication/otpforevc DSC — build content as a string {"gstin", "ret_period", "chksum", "summ_typ": "L"} and sign it with the signatory's DSC for a PKCS#7 pkcs7. Required for companies. EVC — send the OTP to the signatory.
  12. 12 File POST /gstr9/retfile · /gstr9/retevcfile DSC — body {"content", "pkcs7"}. EVC — the summary string {"gstin", "ret_period", "chksum"} as the body. Success returns the ARN: store it, set FILED, unlock GSTR-9C. If the response is lost, check return track before trying again.

Tax shown in Table 14 as additional liability is not paid through this flow — the taxpayer pays it separately through DRC-03.

GSTR-9A lifecycle

A shorter GSTR-9: no 8A, no HSN, no separate proceed-to-file. Show it only for a composition GSTIN in a year where GSTR-9A applies — from FY 2019-20 onward, route composition taxpayers to GSTR-4 annual instead.

  1. 1 Session and pre-check As GSTR-9 steps 1 and 2. Confirm every composition return for the FY is filed.
  2. 2 Auto-calculated figures GET /gstr9a/getautocal — store with source autocalc.
  3. 3 Read any portal draft GET /gstr9a/getdet. If a draft is saved on the portal, load it and let the user choose which version to keep.
  4. 4 User edits The same checks as GSTR-9.
  5. 5 Save PUT /gstr9a/retsave, body {"gstin", "fp", "table5", "table6": {"flag": "D", …}}. Store the reference id.
  6. 6 Poll the save status GET /gstr/retstatus, the same P / PE / ER / IP / REC rules.
  7. 7 Final summary GET /gstr9a/getdet. Show the late fee, store the chksum.
  8. 8 File DSC — POST /gstr9a/retfile. EVC — otpforevc, then POST /gstr9a/retevcfile. Store the ARN, set FILED.

GSTR-9C lifecycle

The reconciliation between the audited accounts and the filed GSTR-9. Seven calls, and for DSC it ends with a hash that must be signed.

  1. 1 Check the gate GSTR-9 for this GSTIN and FY must be FILED with an ARN, and turnover above ₹5 crore. Otherwise hide the module.
  2. 2 Pull the filed GSTR-9 figures GET /gstr9c/getrecds — turnover, tax paid and ITC. These prefill the "as per GSTR-9" columns and stay read-only.
  3. 3 The books side The user enters turnover, tax and ITC from the audited accounts (Part A tables 5, 7, 9, 12, 14) with a reason for each difference. The CRM computes the unreconciled amounts.
  4. 4 Save and poll PUT /gstr9c/retsave returns a reference id. P — go on. PE / ER — back a step. IP / REC — poll again.
  5. 5 Read it back GET /gstr9c/retsum for a final review. Any change sends you back to the books step.
  6. 6 Generate the certificate PUT /gstr9c/gencert with isauditor (Y for an auditor, N for self-certified) and cert_data: balance sheet date, accounts period, taxpayer name and address, place and signatory.
  7. 7 Generate the hash PUT /gstr9c/genhash returns the hash to be signed. Do not change the payload afterwards — if you do, generate a new hash.
  8. 8 Sign DSC — sign the hash for a pkcs7, required for companies. EVC — otpforevc to the signatory.
  9. 9 File DSC — POST /gstr9c/retfile with {content, pkcs7}. EVC — POST /gstr9c/retevcfile. Success returns the ARN.

Anything still payable after reconciliation goes through DRC-03, the same as GSTR-9 Table 14.

Status and error handling

Drive the whole UI from one status column on annual_returns. Each API response moves the return to exactly one next state.

CRM statusSet whenAllowed next call
NOT_STARTED Return row created Auth, pre-check
BLOCKED_PREREQ Pre-check found pending periods Pre-check again
DATA_FETCHING Auto calc, 8A or HSN in progress Get 8A Details (poll)
DRAFT All source data stored Save
SAVE_SUBMITTED Save returned a reference id Return Status
SAVE_ERROR Status PE or ER Save, after edits
SAVED Status P Get Details, or Get Summary for 9C
READY_TO_FILE Final summary read; chksum and late fee stored File by DSC or EVC, or Save to re-open
FILING File call sent None — wait for the response
FILED ARN received None; unlocks 9C after GSTR-9

Return status codes

CodeMeaningWhat the CRM does
REC Received, not processed yet Poll after a short delay
IP In progress Poll, backing off after a few tries
P Processed Move to the next step
PE Processed with errors Show error_report per table; set SAVE_ERROR
ER Error, nothing saved Show error_cd and message; set SAVE_ERROR

Error rules

Session expired

Try one refresh. If that fails, ask for a new OTP. Never auto-retry a File call.

A File call that timed out

Do not send it again. Check return track first — if it already shows Filed, store the ARN from there.

Polling

Exponential back-off with a maximum number of attempts, in a queue job rather than the web request.

Concurrency

One txn per call, and a lock per GSTIN + FY + form so two users cannot save or file at once.

Audit

Store request, response, txn, reference id and error_cd for every call.

Developer checklist

The ticks are yours alone — nothing is saved or sent anywhere.

Stuck on one of these calls against a sandbox GSTIN? The agent knows these flows.

Ask the GST AI Agent All return guides

We use cookies to give you the best possible experience while you browse through our website. By pursuing the use of our website you implicitly agree to the usage of cookies on this site. Learn more

Your Cookie Preference

We use different types of cookies to optimize your experience on our website. Click on the categories that you want to allow. Visit our website to learn more about our Cookie Policy.

Essential

These cookies are necessary for the basic functionality of the website. Without these cookies, certain functions, like sign-in and your saved preferences, will not work.

Performance

These cookies are used to enhance your browsing experience and assist us with support tools, such as live chat.

Analytics

These cookies help us understand how our website is used, so we can improve it over time.