All GST return statement API calls

GSTR-2B API: fetch the ITC statement

POST /v1/gstr2b/fetch

Short answer

Send a connected GSTIN and a return period (MMYYYY) and get the GSTR-2B statement back as JSON: the input tax credit summary, supplier summary and invoice-level documents, with the field names the GST network uses. It is read-only: nothing is filed or paid.

Cost: 3 credits per successful fetch. Generating and polling are free, and 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.

What comes back

The statement sits under data, passed through from the GST network without renaming. In live use it carries the ITC summary, the supplier-wise summary and the document data, including each supplier's GSTIN (ctin), trade name (trdnm) and a checksum.

The exact shape can still move as more real periods are seen, so read it defensively: look fields up by name and do not assume every optional field is present.

When the statement does not exist yet

GSTN generates GSTR-2B itself once a month. If you need one sooner, or after suppliers filed late, ask for it on demand with the generate call, poll until it finishes, then fetch.

Request fields

FieldTypeRequiredMeaning
gstinstringYesThe GSTIN whose statement you want. It must be connected first.
ret_periodstringYesReturn period as MMYYYY, for example 042026.
file_numstringNoWhich generation of that period's statement to read, if it was regenerated more than once. Leave it out for the default.
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/gstr2b/fetch" \
  -H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{ "gstin": "27ABCDE1234F1Z5", "ret_period": "042026", "test_mode": true }'

Response

{
  "success": true,
  "data": { "gstin": "27ABCDE1234F1Z5", "...": "invoice-level ITC statement" },
  "credits_charged": 3,
  "billed_to": "paid",
  "credits_remaining": 97
}

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.

Questions

Can I fetch GSTR-2B for any GSTIN?
Only for a GSTIN you have connected with its own OTP. The statement is the taxpayer's own data, so it cannot be fetched for someone else's GSTIN.
Is a failed fetch charged?
No. Only a real success is charged, 3 credits.
Does it need a paid account?
Yes for real data. test_mode returns a sample in the live shape for free.

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.