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

# Get sub_ids report



## OpenAPI

````yaml openapi-v2-affiliate-reports get /reports/sub_ids
openapi: 3.0.1
info:
  title: FirstPromoter API
  version: '1.0'
  description: FirstPromoter Affiliate API documentation
servers:
  - url: https://api.firstpromoter.com/api/v2/affiliate
security:
  - BearerAuth: []
paths:
  /reports/sub_ids:
    get:
      tags:
        - Reports
      summary: Get sub_ids report
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - name: columns
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
              enum:
                - clicks_count
                - revenue_amount
                - promoter_earnings_amount
                - referrals_count
                - customers_count
                - sales_count
                - refunds_count
                - cancelled_customers_count
                - referrals_to_customers_cr
                - clicks_to_customers_cr
                - clicks_to_referrals_cr
        - name: q
          in: query
          required: false
          schema:
            type: string
        - name: group_by
          in: query
          required: true
          schema:
            type: string
            enum:
              - day
              - week
              - month
              - year
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date-time
        - name: sorting
          in: query
          required: false
          schema:
            type: object
            additionalProperties:
              type: string
              enum:
                - asc
                - desc
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubIdReportData'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    AccountId:
      name: Account-ID
      in: header
      required: true
      description: Account identifier that specifies which account is making the request
      schema:
        type: string
        example: acc_123456
  schemas:
    SubIdReportData:
      type: object
      properties:
        sub_id:
          type: string
        id:
          type: string
        data:
          type: object
          properties:
            clicks_count:
              type: integer
            revenue_amount:
              type: number
            promoter_earnings_amount:
              type: number
            referrals_count:
              type: integer
            customers_count:
              type: integer
            sales_count:
              type: integer
            refunds_count:
              type: integer
            cancelled_customers_count:
              type: integer
            referrals_to_customers_cr:
              type: number
            clicks_to_customers_cr:
              type: number
            clicks_to_referrals_cr:
              type: number
        sub_data:
          type: array
          items:
            type: object
            properties:
              period:
                type: string
              id:
                type: string
              data: f199290d-70ba-4d56-907d-087786746eed
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
      required:
        - message
        - code
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Access token passed as a Bearer token in the Authorization header

````