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

# Get dashboard analytics

> Get general analytics for dashboard including payments, invoices, providers and customers metrics



## OpenAPI

````yaml post /analytics/dashboard
openapi: 3.1.0
info:
  title: BitGPT 402pay API
  description: Full description of private and dev-availble API endpoints
  version: 1.0.0
  termsOfService: https://bitgpt.xyz/terms
  contact:
    name: API Support
    url: https://help.bitgpt.xyz
    email: support@bitgpt.xyz
servers:
  - url: https://api.bitgpt.xyz
    description: Production API server
security: []
tags:
  - name: Payments
    description: Invoice and payment management endpoints
  - name: Products
    description: Product management endpoints
  - name: dev-api
    description: Developer API endpoints
externalDocs:
  description: Full BitGPT 402pay API documentation
  url: https://docs.bitgpt.xyz
paths:
  /analytics/dashboard:
    post:
      tags:
        - Analytics
        - dev-api
      summary: Get dashboard analytics
      description: >-
        Get general analytics for dashboard including payments, invoices,
        providers and customers metrics
      operationId: getDashboardAnalytics
      requestBody:
        $ref: '#/components/requestBodies/dashboardAnalyticsRequest'
      responses:
        '200':
          $ref: '#/components/responses/dashboardAnalyticsResponse'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
      security:
        - BearerAuth: []
          ApiKeyAuth: []
components:
  requestBodies:
    dashboardAnalyticsRequest:
      required: false
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/dashboardAnalyticsRequest'
  responses:
    '401':
      description: Access token is missing or invalid
      content:
        application/json:
          schema:
            allOf:
              - type: object
                properties:
                  status:
                    type: integer
                    enum:
                      - 400
                      - 401
                      - 403
                      - 404
                    description: Status code of the response
                  data:
                    type:
                      - object
                      - 'null'
                    description: Response data containing the requested object
                  error:
                    type:
                      - string
                      - 'null'
                    examples:
                      - Invalid email address
                    description: Error message of the response, human readable
                  message:
                    type: 'null'
                  env:
                    type: string
                    enum:
                      - development
                      - production
                    description: API environment
                  log:
                    type:
                      - string
                      - object
                      - 'null'
                    examples:
                      - request_id: req_1234567890
                      - Some pertinent log message
                    description: >-
                      Useful informaiton, not always present, to debug the
                      response
                  validator:
                    type:
                      - object
                      - 'null'
                    examples:
                      - email: Invalid email address
                        password: Password is required
                    description: >-
                      Validator response object, each key is the field name and
                      value is the error message
                  support_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                    examples:
                      - support_uuidv7-something-else
                    description: >-
                      Support ID linked to the response, used to identify it
                      when talking with our team
                required:
                  - status
                  - error
                  - message
                  - env
                  - log
                  - validator
                  - support_id
              - properties:
                  status:
                    type: integer
                    enum:
                      - 401
    '403':
      description: You do not have the required permissions to access this resource
      content:
        application/json:
          schema:
            allOf:
              - type: object
                properties:
                  status:
                    type: integer
                    enum:
                      - 400
                      - 401
                      - 403
                      - 404
                    description: Status code of the response
                  data:
                    type:
                      - object
                      - 'null'
                    description: Response data containing the requested object
                  error:
                    type:
                      - string
                      - 'null'
                    examples:
                      - Invalid email address
                    description: Error message of the response, human readable
                  message:
                    type: 'null'
                  env:
                    type: string
                    enum:
                      - development
                      - production
                    description: API environment
                  log:
                    type:
                      - string
                      - object
                      - 'null'
                    examples:
                      - request_id: req_1234567890
                      - Some pertinent log message
                    description: >-
                      Useful informaiton, not always present, to debug the
                      response
                  validator:
                    type:
                      - object
                      - 'null'
                    examples:
                      - email: Invalid email address
                        password: Password is required
                    description: >-
                      Validator response object, each key is the field name and
                      value is the error message
                  support_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                    examples:
                      - support_uuidv7-something-else
                    description: >-
                      Support ID linked to the response, used to identify it
                      when talking with our team
                required:
                  - status
                  - error
                  - message
                  - env
                  - log
                  - validator
                  - support_id
              - properties:
                  status:
                    type: integer
                    enum:
                      - 403
    dashboardAnalyticsResponse:
      description: Dashboard analytics data
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Response200'
              - $ref: '#/components/schemas/dashboardAnalyticsResponse'
  schemas:
    dashboardAnalyticsRequest:
      type: object
      properties:
        period:
          type: string
          description: Analytics period
          enum:
            - last_day
            - last_7_days
            - last_30_days
            - last_90_days
            - last_365_days
            - prev_last_day
            - prev_last_7_days
            - prev_last_30_days
            - prev_last_90_days
            - prev_last_365_days
          examples:
            - last_7_days
    Response200:
      type: object
      properties:
        status:
          type: integer
          enum:
            - 200
            - 201
            - 202
          description: Status code of the response
        data:
          type:
            - object
            - array
            - 'null'
          description: Response data containing the requested object
        error:
          type:
            - string
            - 'null'
          examples:
            - Invalid email address
          description: Error message of the response, human readable
        message:
          type:
            - string
            - 'null'
          examples:
            - Resource created successfully
          description: Message of the response, human readable
        env:
          type: string
          enum:
            - development
            - production
          description: API environment
        log:
          type:
            - string
            - object
            - 'null'
          examples:
            - request_id: req_1234567890
            - Some pertinent log message
          description: Useful informaiton, not always present, to debug the response
        validator:
          type:
            - object
            - 'null'
          examples:
            - email: Invalid email address
              password: Password is required
          description: >-
            Validator response object, each key is the field name and value is
            the error message
        support_id:
          type:
            - string
            - 'null'
          format: uuid
          examples:
            - support_uuidv7-something-else
          description: >-
            Support ID linked to the response, used to identify it when talking
            with our team
      required:
        - status
        - data
        - message
        - env
      examples:
        - status: 200
          data:
            id: '123'
          error: null
          log: null
          validator: null
          support_id: null
          message: Resource created successfully
          env: development
    dashboardAnalyticsResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            total_payments_metrics:
              type: object
              description: Total payments metrics for the specified period
              properties:
                total:
                  type: number
                  description: Total number of payments
                success:
                  type: number
                  description: Number of successful payments
                failed:
                  type: number
                  description: Number of failed payments
                pending:
                  type: number
                  description: Number of pending payments
                gross_revenue:
                  type: number
                  description: Total gross revenue from payments
                net_revenue:
                  type: number
                  description: Total net revenue from payments after fees
            daily_payments_metrics:
              type: array
              description: Daily payments metrics for the specified period
              items:
                type: object
                properties:
                  day:
                    type: string
                    format: date
                    description: Date for the metrics
                  total:
                    type: number
                    description: Total number of payments on this day
                  success:
                    type: number
                    description: Number of successful payments on this day
                  failed:
                    type: number
                    description: Number of failed payments on this day
                  pending:
                    type: number
                    description: Number of pending payments on this day
                  gross_revenue:
                    type: number
                    description: Gross revenue from payments on this day
                  net_revenue:
                    type: number
                    description: Net revenue from payments on this day after fees
            total_invoices_metrics:
              type: object
              description: Total invoices metrics for the specified period
              properties:
                total:
                  type: number
                  description: Total number of invoices
                completed:
                  type: number
                  description: Number of completed invoices
                pending:
                  type: number
                  description: Number of pending invoices
                voided:
                  type: number
                  description: Number of voided invoices
                processing:
                  type: number
                  description: Number of processing invoices
                customers:
                  type: number
                  description: Number of unique customers with invoices
                gross_revenue:
                  type: number
                  description: Total gross revenue from invoices
                net_revenue:
                  type: number
                  description: Total net revenue from invoices after fees
            total_providers_metrics:
              type: array
              description: Total providers metrics for the specified period
              items:
                type: object
                properties:
                  provider_id:
                    type: string
                    description: Unique identifier for the provider
                  provider_name:
                    type: string
                    description: Name of the provider
                  provider_gateway:
                    type: string
                    description: Payment gateway used by the provider
                  provider_network:
                    type: string
                    description: Network
                  total:
                    type: number
                    description: Total number of payments for this provider
                  success:
                    type: number
                    description: Number of successful payments for this provider
                  failed:
                    type: number
                    description: Number of failed payments for this provider
                  pending:
                    type: number
                    description: Number of pending payments for this provider
                  gross_revenue:
                    type: number
                    description: Gross revenue from payments for this provider
                  net_revenue:
                    type: number
                    description: Net revenue from payments for this provider after fees
            daily_new_customers_metrics:
              type: array
              description: Daily new customers metrics for the specified period
              items:
                type: object
                properties:
                  day:
                    type: string
                    format: date
                    description: Date for the metrics
                  new_customers:
                    type: number
                    description: Number of new customers on this day
          required:
            - total_payments_metrics
            - daily_payments_metrics
            - total_invoices_metrics
            - total_providers_metrics
            - daily_new_customers_metrics
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Send your access token as header Authorization: Bearer {accessToken}'
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your API key that starts with sk_live or sk_test. You can create yours
        at go.bitgpt.xyz/api-keys.

````