> ## Documentation Index
> Fetch the complete documentation index at: https://spidocs.chargebee.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Document Status

> Retrieves the current processing status of a document previously submitted to the connected e-invoicing provider.

The status provides insights into whether the document has been successfully processed, is still under validation, has failed, or has been rejected by tax authorities or intermediaries.

In Chargebee, this endpoint is periodically called to retrieve the latest processing status of the e-invoicing document. While Chargebee primarily relies on the callback listener to receive status updates, this endpoint serves as a fallback mechanism to ensure status synchronization.
'




## OpenAPI

````yaml get /einvoicing/documents/{document_id}/status
openapi: 3.0.0
info:
  description: >
    ## E-invoicing Service Provider Interface (SPI) - Overview
      Chargebee streamlines e-invoicing compliance across regions by facilitating the following operations throughout the billing lifecycle.

    1) Retrieve E-invoicing Activations:
        - Retrieves the list of country and network activations that are configured in the connected e-invoicing provider platform.
        - Each activation reflects a country and e-invoicing network that has been set up and made available by the provider.
        - Chargebee uses this operation during provider enablement to determine which activations can be offered to merchants.
    2) Document Submission:
        - Submits invoices and credit notes to external e-invoicing systems for validation, compliance processing, and delivery to tax authorities or trading partners.
    3) Status Tracking:
        - Supports asynchronous document lifecycle tracking through webhook notifications sent by the e-invoicing adapter. These updates reflect real-time status changes as documents move through validation, compliance, and regulatory delivery stages.
        - Allows on-demand status checks to retrieve the latest processing state of submitted documents, ensuring continued visibility even if webhook delivery is delayed or disrupted.
    4) Final Document Retrieval:
        - Retrieves finalized and regulator-approved documents for archiving, auditing or customer-facing use.

    Chargebee leverages external e-invoicing services to execute these
    operations effectively. These external e-invoicing servies are the 
    certified vendors offering APIs to handle e-invoicing compliance and
    document exchange with tax authorities.


    ## The Role of the E-invoicing Adapter App:
      To connect with external e-invoicing systems, Chargebee uses an E-invoicing Adapter App -  a bridge that enables secure and standardized communication between Chargebee and the e-invoicing system. This communication is governed by the E-invoicing Service Provider Interface (SPI).

    ## Building an E-invoicing Adapter App
      To integrate an e-invoicing system with Chargebee, you must implement the E-invoicing SPI by developing an adapter app. This is required in the following scenarios:

      - As an E-invoicing Provider:
        - Connect your compliance platform to Chargebee so merchants can automatically submit billing documents in a regulator-approved format.
      - As a System Integrator:
        - Build a connector that bridges a third-party e-invoicing provider and Chargebee, enabling seamless integration for merchants.

    By implementing the E-invoicing SPI, you enable Chargebee to support global
    regulatory compliance through a scalable and region-agnostic architecture.
  title: E-Invoicing Service Provider Interface
  version: 1.0.0
servers:
  - description: Production server (replace with actual service URL)
    url: https://api.example.com
  - description: Sandbox server for testing
    url: https://sandbox.example.com
security:
  - ApiKeyAuth: []
tags:
  - description: Operations related to e-invoicing activations
    name: Activations
  - description: Operations related to e-invoicing documents
    name: Documents
paths:
  /einvoicing/documents/{document_id}/status:
    get:
      tags:
        - Documents
      summary: Get Document Status
      description: >
        Retrieves the current processing status of a document previously
        submitted to the connected e-invoicing provider.


        The status provides insights into whether the document has been
        successfully processed, is still under validation, has failed, or has
        been rejected by tax authorities or intermediaries.


        In Chargebee, this endpoint is periodically called to retrieve the
        latest processing status of the e-invoicing document. While Chargebee
        primarily relies on the callback listener to receive status updates,
        this endpoint serves as a fallback mechanism to ensure status
        synchronization.

        '
      operationId: einvoicingDocumentStatus
      parameters:
        - description: >-
            The unique identifier assigned to the submitted document by the
            e‑invoicing provider.
          explode: false
          in: path
          name: document_id
          required: true
          schema:
            type: string
          style: simple
      responses:
        '200':
          content:
            application/json:
              examples:
                successful_einvoice_document_submission_response:
                  description: >-
                    A sample response indicating successful e-invoice document
                    status.
                  summary: Successful document status
                  value:
                    document_id: DOC-20250402-0001
                    status: SUCCESS
                    submission_date: '2025-04-02T07:39:31.815Z'
                    provider_response: >-
                      {"source":"avalara","received_at":"2025-12-29T12:17:47.791Z","payload":{"id":"ad110f2d-9d0a-4435-a8ea-a36caaceb8c7","companyId":"304382fd-1268-4e7b-86db-a8d51ff309d5","status":"Complete"}}
                failed_einvoice_document_submission_response:
                  description: >-
                    A sample failed document status response due to unregistered
                    VAT number.
                  summary: Failed validation at provider
                  value:
                    document_id: DOC-20250402-0001
                    status: FAILED
                    processing_details:
                      errors:
                        - code: INVALID_DATA
                          message: >-
                            The VAT number provided is not registered with the
                            tax authority.
                          help_url: https://docs.example.com/errors#INVALID_DATA
              schema:
                $ref: '#/components/schemas/document_status'
          description: Document status retrieved successfully.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not_found_error_response'
          description: Not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/500_error_response'
          description: Unexpected error while processing request.
components:
  schemas:
    document_status:
      example:
        document_id: DOC-20250402-0001
        status: SUCCESS
        submission_date: '2025-04-02T07:39:31.815Z'
        provider_response: >-
          {"source":"avalara","received_at":"2025-12-29T12:17:47.791Z","payload":{"id":"ad110f2d-9d0a-4435-a8ea-a36caaceb8c7","companyId":"304382fd-1268-4e7b-86db-a8d51ff309d5","status":"Complete"}}
      properties:
        document_id:
          description: >-
            The unique identifier assigned to the document by the e-invoicing
            provider.
          type: string
        status:
          description: The current status of the document submission.
          enum:
            - ACCEPTED
            - FAILED
            - SUCCESS
            - IN_PROGRESS
            - REJECTED
            - MESSAGE_ACKNOWLEDGEMENT
            - IN_PROCESS
            - UNDER_QUERY
            - CONDITIONALLY_ACCEPTED
            - PAID
          type: string
        submission_date:
          description: Date and time when the document was submitted.
          format: date-time
          type: string
        processing_details:
          $ref: '#/components/schemas/bad_request_error_response'
        provider_response:
          description: >
            JSON string containing an optional array of raw payloads received
            from the e-invoicing provider that is used for downstream mapping
            and for audits.

            The JSON should be an array of objects with the following structure:

            [{"source": "string", "received_at": "date-time", "payload":
            {object}}]
          example: >-
            {"source":"avalara","received_at":"2025-12-29T12:17:47.791Z","payload":{"id":"ad110f2d-9d0a-4435-a8ea-a36caaceb8c7","companyId":"304382fd-1268-4e7b-86db-a8d51ff309d5","status":"Complete"}}
          type: string
        provider_references:
          description: >
            Optional JSON array of key-value pairs from the e-invoicing provider
            (e.g. Receipt Message ID, Response Message ID).

            Format: [{"key": "string", "value": "string"}, ...]
          example: >-
            [{"key":"Receipt Message
            ID","value":"3ed9530e-f2e8-4733-ace8-f868a5e077eb@einvoicing.sbx.provider.io"},{"key":"Response
            Message
            ID","value":"3ed9530e-f2e8-4733-aeffe8-f868a5e077eb@einvoicing.sbx.provider.io"}]
          type: string
      required:
        - document_id
        - status
      type: object
    not_found_error_response:
      example:
        errors:
          - code: NOT_FOUND
            message: The requested document is not found.
            help_url: https://docs.example.com/errors#INVALID_OPERATION
      properties:
        errors:
          description: >-
            A list of errors explaining why the requested resource was not
            found.
          items:
            $ref: '#/components/schemas/not_found_error_response_errors_inner'
          type: array
      required:
        - errors
      type: object
    500_error_response:
      description: An unexpected error occurred while processing your request.
      properties:
        message:
          description: A human-readable description of the unexpected error encountered.
          example: An unexpected error occurred while processing your request.
          type: string
        provider_interaction:
          $ref: >-
            #/components/schemas/document_submission_response_provider_interaction
      required:
        - message
    bad_request_error_response:
      example:
        errors:
          - code: MISSING_REQUIRED_DATA
            message: The request did not contain a required property 'taxAmount'
            help_url: https://docs.example.com/errors#MISSING_REQUIRED_PARAMETER
      properties:
        errors:
          items:
            $ref: '#/components/schemas/bad_request_error_response_errors_inner'
          type: array
        provider_interaction:
          $ref: >-
            #/components/schemas/document_submission_response_provider_interaction
      type: object
    not_found_error_response_errors_inner:
      properties:
        code:
          description: Application-specific error code
          enum:
            - NOT_FOUND
          type: string
        message:
          description: A short message describing the reason for the error.
          type: string
        help_url:
          description: >-
            The link to the documentation for more information about the error
            and the corrective action.
          format: uri
          type: string
      required:
        - code
        - message
      type: object
    document_submission_response_provider_interaction:
      description: >
        Captures the interaction between the adapter and the external
        e-invoicing provider.

        Includes both the outbound request details and the inbound response
        received from the provider.

        Intended for internally hosted adapters for audit and traceability of
        SPI transactions.
      example:
        request:
          body: '{}'
        response:
          status_code: 0
          body: '{}'
      properties:
        request:
          $ref: >-
            #/components/schemas/document_submission_response_provider_interaction_request
        response:
          $ref: >-
            #/components/schemas/document_submission_response_provider_interaction_response
      required:
        - request
        - response
      type: object
    bad_request_error_response_errors_inner:
      properties:
        code:
          description: >-
            The error codes classify the type of exception that occurred during
            processing the request.
          enum:
            - INVALID_OPERATION
            - SERVICE_EXCEPTION
            - SERVICE_UNAVAILABLE
            - SERVICE_LIMIT_EXCEEDED
            - MISSING_REQUIRED_DATA
            - INVALID_DATA
          type: string
        message:
          description: A short message describing the reason for the error.
          type: string
        help_url:
          description: >-
            The link to the documentation for more information about the error
            and the corrective action.
          format: uri
          type: string
      required:
        - message
      type: object
    document_submission_response_provider_interaction_request:
      description: >-
        Details of the HTTP request sent by the adapter to the external
        provider.
      example:
        body: '{}'
      properties:
        body:
          description: >
            The request payload sent to the provider API, typically serialized
            as JSON.

            This should exclude any sensitive or personally identifiable
            information.
          type: object
      type: object
    document_submission_response_provider_interaction_response:
      description: Details of the HTTP response received from the external provider.
      example:
        status_code: 0
        body: '{}'
      properties:
        status_code:
          description: The HTTP status code returned by the provider.
          type: integer
        body:
          description: |
            The response body returned by the provider.
          type: object
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey

````