All GST return statement API calls

GSTR-2A API: fetch a table

POST /v1/gstr2a/fetch

Short answer

Pick one of the 12 GSTR-2A tables with the table field, send a connected GSTIN and a period, and get that table back as JSON. GSTR-2A is the live purchase-side statement built as suppliers file, so it keeps changing within the month.

Cost: 2 credits per successful call, the same for every one of the 12 tables. A table that is legitimately empty for the period is still charged, because the lookup was made; an error is never charged.

Every call accepts "test_mode": true and returns a sample in the live shape, free. How the connection works before the first real call.

Connect the GSTIN once

These calls act on a GSTIN through a connection you make once in the dashboard, under GST Return Filing. You enter the GSTIN and the GST portal username that is registered as its API user, and the GST portal sends an OTP to the registered mobile number or email.

The connection lasts about six hours. After that the API answers 409 NOT_CONNECTED and you reconnect with a new OTP. One connection covers GSTR-2B, GSTR-2A and the other return calls.

The 12 tables

b2b (B2B invoices), b2ba (amended B2B), cdn (credit and debit notes), cdna (amended notes), impg (import of goods), impgsez (import from SEZ), tcs (tax collected at source), tds (tax deducted at source), amdhist (bill-of-entry amendment history), ecom (e-commerce), ecoma (amended e-commerce) and isd (Input Service Distributor credits).

One call fetches one table. Getting every table for a period takes up to 12 calls.

Optional filters, and one table with extra fields

Most tables accept ctin (a supplier's GSTIN) and fromtime as optional filters. amdhist is the exception: it also requires portcode, benumber and bedate.

An empty table is normal

A GSTIN with no entries in a table for the period gets a successful answer with nothing in it, not an error. The GST network words it as "No document found for the provided Inputs". Most accounts see this on several of the 12 tables every period.

Request fields

FieldTypeRequiredMeaning
tablestringYesOne of b2b, b2ba, cdn, cdna, impg, impgsez, tcs, tds, amdhist, ecom, ecoma, isd.
gstinstringYesThe GSTIN whose statement you want. It must be connected first.
ret_periodstringYesReturn period as MMYYYY, for example 042026.
ctinstringNoOnly this supplier's GSTIN, on tables that accept it.
fromtimestringNoOptional time filter, on tables that accept it.
portcode / benumber / bedatestringNoRequired only for amdhist.
test_modebooleanNotrue returns a sample in the live shape: free, never reaches the GST network.

Send your API key in the x-api-key header. The GSTIN is acted on through its connection, so no GST portal password is sent with the call.

Example

The request below runs in test mode, so it is free and files nothing. Remove test_mode for a real call.

curl -X POST "https://www.gstinapi.in/v1/gstr2a/fetch" \
  -H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{ "table": "b2b", "gstin": "27ABCDE1234F1Z5", "ret_period": "042026", "test_mode": true }'

Response

{
  "success": true,
  "table": "b2b",
  "data": { "inv": [ { "ctin": "27AABCT1332L000", "trdnm": "EXAMPLE SUPPLIER PVT LTD", "chksum": "...", "...": "invoice-level detail" } ] },
  "credits_charged": 2,
  "billed_to": "paid",
  "credits_remaining": 95
}

Errors you can expect

CodeMessageWhat to do
409NOT_CONNECTEDThe GSTIN is not connected, or its six-hour connection expired. Reconnect it in the dashboard with a new OTP. Not charged.
RET2B1013 / RET01203GSTIN in request doesnt match with sessionThe GST portal username you connected is not the API user of this GSTIN. It is a username/GSTIN pairing problem, not a missing feature. Reconnect with the right pair.
402insufficient_creditsThe account has fewer credits than the call costs. Buy a pack, or use test_mode.
400Unknown tabletable must be one of the 12 names above. Not charged.

Questions

Is there one call for the whole GSTR-2A?
No. The GST network serves it as 12 separate tables, so a full statement is up to 12 calls at 2 credits each.
Does the price change by table?
No. Every table costs the same 2 credits on a real success.

Not affiliated with the Government of India. Rules are the government network's own and can change; if a page here looks out of date, tell us.