> ## 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.

# Fetch the health status of the Service Provider.

> This endpoint is used to fetch the health status of the Service Provider.



## OpenAPI

````yaml get /health
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:
  /health:
    get:
      tags:
        - Health
      summary: Fetch the health status of the Service Provider.
      description: >-
        This endpoint is used to fetch the health status of the Service
        Provider.
      operationId: fetchHealth
      parameters:
        - description: Merchant's domain name will be sent by Chargebee
          in: header
          name: merchant_id
          required: false
          schema:
            type: string
        - description: Unique id of the request will be sent by Chargebee
          in: header
          name: trace_id
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                status: UP
                version: 1.0.0
                description: The service is healthy.
                components:
                  - id: app-db-memory
                    name: Application Database
                    type: DATABASE
                    status: UP
                  - id: adapter-server
                    name: Adapter API Server
                    type: ADAPTER
                    status: UP
                  - id: service-server
                    name: API Server
                    type: API
                    status: UP
                time: '2022-11-01T05:12:08.131Z'
              schema:
                $ref: '#/components/schemas/HealthCheckResponse'
          description: Service is healthy.
        '429':
          description: Too many requests.
        '500':
          content:
            application/json:
              example:
                message: Unexpected error during processing the request.
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
          description: Unexpected error while processing request.
        '503':
          content:
            application/json:
              example:
                status: DOWN
                version: 1.0.0
                description: The service is unhealthy. Several components are down.
                components:
                  - id: app-db-memory
                    name: Application Database Memory Usage
                    type: DATABASE
                    status: UP
                  - id: adapter-server
                    name: Adapter API Server
                    type: ADAPTER
                    status: DOWN
                  - id: service-server
                    name: API Server
                    type: API
                    status: DOWN
                time: '2022-11-01T05:12:08.131Z'
              schema:
                $ref: '#/components/schemas/HealthCheckResponse'
          description: Service is unhealthy.
components:
  schemas:
    HealthCheckResponse:
      example:
        components:
          - endpoints:
              - endpoints
              - endpoints
            name: name
            description: description
            id: id
            type: OTHER
            status: null
          - endpoints:
              - endpoints
              - endpoints
            name: name
            description: description
            id: id
            type: OTHER
            status: null
        description: description
        time: '2000-01-23T04:56:07.000Z'
        version: version
        status: null
      properties:
        version:
          minLength: 1
          type: string
        description:
          description: >-
            The description of the health status returned by the Service
            Adapter.
          maxLength: 250
          type: string
        status:
          $ref: '#/components/schemas/HealthStatus'
        components:
          description: >-
            List of health status details for each component reported by the
            Service Adapter.
          items:
            $ref: '#/components/schemas/HealthCheckComponent'
          type: array
        time:
          description: The timestamp of the health status reported by the Service Adapter.
          format: date-time
          type: string
      required:
        - components
        - status
        - time
      type: object
    BasicErrorResponse:
      additionalProperties: false
      description: >-
        The basic error response containing the error message and the help
        documentation link.
      properties:
        message:
          description: The description of the error with details about it's cause.
          example: Invalid Credentials
          maxLength: 250
          type: string
        helpUrl:
          description: >-
            The link to the documentation for more information about the error
            and the corrective action.
          example: https://apidocs.chargebee.com#Authentication
          format: uri
          type: string
      required:
        - message
      type: object
    HealthStatus:
      description: The status of a specific component reported by the Service Adapter.
      enum:
        - UP
        - DOWN
        - WARN
      type: string
    HealthCheckComponent:
      description: >-
        The health status details of a specific component reported by the
        Service Adapter.
      example:
        endpoints:
          - endpoints
          - endpoints
        name: name
        description: description
        id: id
        type: OTHER
        status: null
      properties:
        id:
          description: The id of the component.
          maxLength: 50
          type: string
        name:
          description: The name of the component.
          maxLength: 150
          type: string
        type:
          description: >
            The type of component affected when `status` is `WARN` or `DOWN`.
            The possible values are:

            - `ADAPTER`: The reported status is for the Service Adapter.

            - `API`: The reported status is for the Service Provider.

            - `DATABASE`: The reported status is for a database dependency of
            the Service Provider.

            - `SYSTEM`: The reported status is for any other known system
            component such as cache or gateway.

            - `OTHER`: The reported status is either for a component that does
            not belong to the types described above or the source of the issue
            is unknown.
          enum:
            - OTHER
            - SYSTEM
            - API
            - ADAPTER
            - DATABASE
          type: string
        description:
          description: The detailed status of the component.
          maxLength: 250
          type: string
        status:
          $ref: '#/components/schemas/HealthStatus'
        endpoints:
          description: >-
            When the `status` of the component is not `UP`, then the list of
            endpoints affected.
          items:
            type: string
          type: array
      required:
        - id
        - name
        - status
        - type
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey

````