> ## Documentation Index
> Fetch the complete documentation index at: https://developer.sandbox.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Get IMS invoice file details

> Retrieve download links for large Invoice Management System (IMS) results. Download decrypted JSON files using signed URLs valid for one day.

Pass the file-generation token returned by [Get Invoices](https://developer.sandbox.co.in/api-reference/gst/compliance/endpoints/taxpayer/invoices/invoices.md), using the same taxpayer session and provider.

If GSTN returns `IMS_FILEGEN_03`, retry later with the same token. When files are ready, download every file in `data.data.files`. Each download link is valid for one day and needs no authorization header.


## OpenAPI

````yaml api-reference/gst/compliance/openapi.json GET /gst/enriched/compliance/tax-payer/invoices/file-details
openapi: 3.0.1
info:
  title: compliance
  description: >-
    **GST Compliance API** enables businesses to automate compliance
    requirements like [Taxpayer
    verification](https://developer.sandbox.co.in/reference/search-gstin-api),
    [GSTR
    Filing](https://developer.sandbox.co.in/reference/gst-taxpayer-authentication),
    [Generating
    E-Invoices](https://developer.sandbox.co.in/reference/e-invoice-authentication-api),
    and [E-Way
    Bills](https://developer.sandbox.co.in/reference/e-way-bill-authentication-api).We
    provide these APIs from GSTN-authorised GST Suvidha Providers, handling the
    encryption-decryption and signing so you don't have to handle the
    complexities.
  version: 1.0.0
servers:
  - url: https://api.sandbox.co.in
    description: prod
  - url: https://test-api.sandbox.co.in
    description: test
security: []
tags:
  - name: Public
  - name: Taxpayer
  - name: Taxpayer Auth
  - name: Returns
  - name: GSTR-1 Documents
  - name: File GSTR-1
  - name: GSTR-2A Documents
  - name: GSTR-2B Document
  - name: File GSTR-3B
  - name: GSTR-4
  - name: File GSTR-9
  - name: Invoice Management System
  - name: GSTR-1A Documents
  - name: File GSTR-1A
  - name: Ledgers
  - name: e-Invoice
  - name: Sales e-Invoices for return period
  - name: Purchase e-Invoices for return period
  - name: Front Office Notices
  - name: Front Office
  - name: AATO
  - name: e-Invoice1
  - name: Authentication
  - name: e-Invoice12
  - name: E-Way Bill
  - name: E-Way Bill1
  - name: Authentication1
  - name: Consignor
  - name: Consolidated E-Way Bill
  - name: Multi-Vehicle Movement
  - name: Consignee
  - name: Transporter
  - name: Consolidated E-Way Bill1
  - name: Multi-vehicle Movement
  - name: Common
paths:
  /gst/enriched/compliance/tax-payer/invoices/file-details:
    get:
      tags:
        - Taxpayer/Returns/Invoice Management System
        - Taxpayer
        - Invoice Management System
        - Enriched
      summary: Get IMS invoice file details
      description: >-
        Returns download URLs for decrypted IMS invoice JSON files generated by
        GSTN. The required `token` comes from an IMS response that returns a
        file-generation token, such as Get IMS invoices.


        The request uses the same taxpayer access token and `x-source` value as
        the request that produced the token. It does not take a return period or
        a job ID.


        When files are ready, `data.status_cd` is `"1"` and `data.data.files`
        contains the download links. Each link expires 24 hours after it is
        generated. The downloaded files contain decrypted JSON. Each file is
        returned separately, without merging invoice sections.


        While GSTN is generating the files, the API returns HTTP 200 with
        `data.status_cd: "0"` and `data.error.error_cd: "IMS_FILEGEN_03"`. The
        GSTN error object is preserved. Other GSTN business errors also remain
        HTTP 200.


        A failed download, integrity check, decryption, or upload does not
        return a partial list of download links.


        HTTP 502 indicates a source download, archive, integrity, decryption
        failure. HTTP 500 indicates a file storage failure. HTTP 504 indicates
        that file processing timed out. These failures do not return download
        links.


        Saved examples are illustrative unless stated otherwise. Use a token
        from Get IMS invoices with the same taxpayer session and provider. The
        token does not select an example outcome. The checksum mismatch example
        requires a damaged-download fixture. Example signed URLs are not live
        links.
      operationId: getEnrichedImsFileDetails
      parameters:
        - name: token
          in: query
          description: >-
            File-generation token returned by GSTN for this taxpayer. Pass the
            value unchanged.
          required: true
          example: '{{ims_file_token}}'
          schema:
            type: string
            minLength: 1
        - name: x-api-version
          in: header
          description: API version
          required: false
          example: ''
          schema:
            type: string
            default: 1.0.0
        - name: x-source
          in: header
          description: >-
            Provider selection. Use the same value as the request that returned
            the token.
          required: false
          example: primary
          schema:
            type: string
      responses:
        '200':
          description: Download links or an unchanged GSTN business error.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    required:
                      - code
                      - timestamp
                      - transaction_id
                      - data
                    properties:
                      code:
                        type: integer
                        enum:
                          - 200
                      timestamp:
                        type: integer
                        format: int64
                        description: Response time in Unix milliseconds.
                      transaction_id:
                        type: string
                        format: uuid
                        description: Identifier for this API request.
                      data:
                        type: object
                        required:
                          - status_cd
                          - data
                        properties:
                          status_cd:
                            type: string
                            enum:
                              - '1'
                          data:
                            type: object
                            required:
                              - files
                            properties:
                              files:
                                type: array
                                description: >-
                                  Download links for every decrypted JSON file.
                                  Files remain separate.
                                items:
                                  type: object
                                  required:
                                    - url
                                  properties:
                                    url:
                                      type: string
                                      format: uri
                                      description: >-
                                        Signed GET URL for a decrypted JSON
                                        file. No authorization header is needed
                                        for the download.
                                  x-apidog-ignore-properties: []
                                  x-apidog-orders:
                                    - url
                            x-apidog-ignore-properties: []
                            x-apidog-orders:
                              - files
                        x-apidog-ignore-properties: []
                        x-apidog-orders:
                          - status_cd
                          - data
                    x-apidog-ignore-properties: []
                    x-apidog-orders:
                      - code
                      - timestamp
                      - transaction_id
                      - data
                  - type: object
                    required:
                      - code
                      - timestamp
                      - transaction_id
                      - data
                    properties:
                      code:
                        type: integer
                        enum:
                          - 200
                      timestamp:
                        type: integer
                        format: int64
                        description: Response time in Unix milliseconds.
                      transaction_id:
                        type: string
                        format: uuid
                        description: Identifier for this API request.
                      data:
                        type: object
                        required:
                          - status_cd
                          - error
                        properties:
                          status_cd:
                            type: string
                            enum:
                              - '0'
                          error:
                            type: object
                            required:
                              - error_cd
                              - message
                            properties:
                              error_cd:
                                type: string
                                description: >-
                                  GSTN business error code. IMS_FILEGEN_03 means
                                  file generation is still in progress.
                              message:
                                type: string
                                description: Message returned by GSTN.
                            x-apidog-ignore-properties: []
                            x-apidog-orders:
                              - error_cd
                              - message
                        x-apidog-ignore-properties: []
                        x-apidog-orders:
                          - status_cd
                          - error
                    x-apidog-ignore-properties: []
                    x-apidog-orders:
                      - code
                      - timestamp
                      - transaction_id
                      - data
              examples:
                Get IMS invoice file details - files ready -> 200 with status_cd=1:
                  summary: >-
                    Get IMS invoice file details - files ready -> 200 with
                    status_cd=1
                  value:
                    code: 200
                    timestamp: 1796032800000
                    transaction_id: 8e7ec144-236f-4ead-aec2-57f2da120b81
                    data:
                      status_cd: '1'
                      data:
                        files:
                          - url: >-
                              https://downloads.example.com/ims/part-0001.json?X-Amz-Expires=86400&X-Amz-Signature=example
                          - url: >-
                              https://downloads.example.com/ims/part-0002.json?X-Amz-Expires=86400&X-Amz-Signature=example
                Get IMS invoice file details - generation in progress -> 200 with IMS_FILEGEN_03:
                  summary: >-
                    Get IMS invoice file details - generation in progress -> 200
                    with IMS_FILEGEN_03
                  value:
                    code: 200
                    timestamp: 1796032800000
                    data:
                      status_cd: '0'
                      error:
                        error_cd: IMS_FILEGEN_03
                        message: >-
                          File Generation is in progress, please try after
                          sometime.
                    transaction_id: 8e7ec144-236f-4ead-aec2-57f2da120b81
                Get IMS invoice file details - file details not found -> 200 with RET13508:
                  summary: >-
                    Get IMS invoice file details - file details not found -> 200
                    with RET13508
                  value:
                    code: 200
                    timestamp: 1796032800000
                    transaction_id: 8e7ec144-236f-4ead-aec2-57f2da120b81
                    data:
                      status_cd: '0'
                      error:
                        error_cd: RET13508
                        message: No Details Found for the Provided Inputs
          headers: {}
          x-apidog-name: OK
          x-apidog-ordering: 0
        '400':
          description: The required token query parameter is absent.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - transaction_id
                  - timestamp
                properties:
                  code:
                    type: integer
                    enum:
                      - 400
                  message:
                    type: string
                  transaction_id:
                    type: string
                    format: uuid
                  timestamp:
                    oneOf:
                      - type: string
                      - type: integer
                    description: Request time in Unix milliseconds.
                x-apidog-ignore-properties: []
                x-apidog-orders:
                  - code
                  - message
                  - transaction_id
                  - timestamp
              examples:
                Get IMS invoice file details - token absent -> 400:
                  summary: Get IMS invoice file details - token absent -> 400
                  value:
                    transaction_id: c631200f-2810-4346-8060-acd94aec4901
                    code: 400
                    message: >-
                      Required request parameter 'token' for method parameter
                      type String is not present
                    timestamp: 1796105560000
          headers: {}
          x-apidog-name: Token missing
          x-apidog-ordering: 4
        '500':
          description: >-
            The API could not store the processed file or generate its download
            URL.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - transaction_id
                  - timestamp
                properties:
                  code:
                    type: integer
                    enum:
                      - 500
                  message:
                    type: string
                  transaction_id:
                    type: string
                    format: uuid
                  timestamp:
                    oneOf:
                      - type: string
                      - type: integer
                    description: Request time in Unix milliseconds.
                x-apidog-ignore-properties: []
                x-apidog-orders:
                  - code
                  - message
                  - transaction_id
                  - timestamp
          headers: {}
          x-apidog-name: File storage failed
          x-apidog-ordering: 1
        '502':
          description: >-
            The API could not download, verify, extract, decrypt, or parse the
            source files.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - transaction_id
                  - timestamp
                properties:
                  code:
                    type: integer
                    enum:
                      - 502
                  message:
                    type: string
                  transaction_id:
                    type: string
                    format: uuid
                  timestamp:
                    oneOf:
                      - type: string
                      - type: integer
                    description: Request time in Unix milliseconds.
                x-apidog-ignore-properties: []
                x-apidog-orders:
                  - code
                  - message
                  - transaction_id
                  - timestamp
              examples:
                Get IMS invoice file details - checksum mismatch fixture -> 502:
                  summary: >-
                    Get IMS invoice file details - checksum mismatch fixture ->
                    502
                  value:
                    code: 502
                    timestamp: 1796032800000
                    transaction_id: 8e7ec144-236f-4ead-aec2-57f2da120b81
                    message: File integrity verification failed
          headers: {}
          x-apidog-name: Invalid source file
          x-apidog-ordering: 2
        '504':
          description: >-
            File processing exceeded the available time. The same GSTN token can
            be used in another File Details request.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - transaction_id
                  - timestamp
                properties:
                  code:
                    type: integer
                    enum:
                      - 504
                  message:
                    type: string
                  transaction_id:
                    type: string
                    format: uuid
                  timestamp:
                    oneOf:
                      - type: string
                      - type: integer
                    description: Request time in Unix milliseconds.
                x-apidog-ignore-properties: []
                x-apidog-orders:
                  - code
                  - message
                  - transaction_id
                  - timestamp
          headers: {}
          x-apidog-name: File processing timed out
          x-apidog-ordering: 3
      deprecated: false
      security:
        - GstTaxpayerAccessToken: []
          SandboxApiKey1: []
components:
  securitySchemes:
    GstTaxpayerAccessToken:
      type: apiKey
      in: header
      name: authorization
      description: >-
        GST taxpayer access token returned by [Verify
        OTP](/api-reference/gst/compliance/endpoints/taxpayer/authentication/verify_otp).
      x-apidog-folder: SecurityScheme
    SandboxApiKey1:
      type: apiKey
      in: header
      name: x-api-key
      description: Sandbox API key from your Sandbox account.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.