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

# Get purchases



## OpenAPI

````yaml get /5f439e2e64d89817e562a811/analytics
openapi: 3.0.3
info:
  title: API V2
  version: 1.0.0
  contact: {}
servers:
  - url: http://staging.qshop.ng/apiv2
    description: Staging server
  - url: http://qshop.ng/api
    description: null
security: []
tags:
  - name: Analytics
  - name: Authentication
  - name: Storefront
  - name: Roles
  - name: Banks
  - name: Products
  - name: Shops
  - name: Roles1
  - name: Bank accounts
  - name: Users
  - name: Payment methods
  - name: Integrations
  - name: Subscriptions
  - name: Currency
  - name: Shipping zones
  - name: Shipping rates
  - name: Policies
  - name: Contact us
  - name: Locations
  - name: Reviews
  - name: Referral
  - name: Stripe
  - name: Campaigns
  - name: Credits
  - name: Product Tags
  - name: Product Attributes
  - name: Product Categories
  - name: Orders
  - name: Discount
  - name: Shipping
  - name: Redeem digital assets
  - name: Coupons
  - name: Currencies
  - name: Shop categories
  - name: Locations1
  - name: Features
  - name: Subscription plan
  - name: Recurring subscription plan
  - name: Shop payments
  - name: QDiscounts
  - name: Order status
  - name: Announcements
  - name: Wishlist
  - name: Transaction status
  - name: Templates
  - name: Config
  - name: Cart management
  - name: Users1
  - name: Profile
  - name: Domains
  - name: Transactions
  - name: Subscriptions1
  - name: Subscription statuses
  - name: Security
  - name: Payments
  - name: Payment methods1
  - name: Payment platforms
  - name: Public
  - name: social
  - name: Shipping1
  - name: Orders1
  - name: Integrations1
  - name: Webhook
  - name: ShopTags
  - name: Themes
paths:
  /5f439e2e64d89817e562a811/analytics:
    get:
      tags:
        - Analytics
      summary: Get purchases
      description: Get purchases
      operationId: getPurchases
      parameters:
        - name: startDate
          in: query
          schema:
            type: string
            example: '2022-02-01'
        - name: endDate
          in: query
          schema:
            type: string
            example: '2022-03-01'
        - name: limit
          in: query
          schema:
            type: string
            example: '3'
        - name: type
          in: query
          schema:
            type: string
            example: purchases
      responses:
        '200':
          description: '200'
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
                example: >-
                  Content-Type, Authorization, Content-Length, X-Requested-With,
                  Token
            Access-Control-Allow-Methods:
              schema:
                type: string
                example: GET,PUT,POST,DELETE,OPTIONS,PATCH
            Access-Control-Allow-Origin:
              schema:
                type: string
                example: '*'
            Connection:
              schema:
                type: string
                example: keep-alive
            Content-Length:
              schema:
                type: string
                example: '2964'
            Date:
              schema:
                type: string
                example: Mon, 21 Nov 2022 13:38:29 GMT
            ETag:
              schema:
                type: string
                example: W/"b94-KBlkHzkDaH4ZY5dBpoHjg+SFLtI"
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            X-Powered-By:
              schema:
                type: string
                example: Express
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      products:
                        type: object
                        properties:
                          currentPage:
                            type: number
                            example: 1
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                _id:
                                  type: string
                                  example: 60b5098f3a9a2946cbb01c00
                                costPrice:
                                  nullable: true
                                  example: null
                                name:
                                  type: string
                                  example: '😲 '
                                price:
                                  type: number
                                  example: 2000
                                sale_price:
                                  type: number
                                  nullable: true
                                  example: null
                                stock:
                                  type: number
                                  example: 20256
                            example:
                              - _id: 60b5098f3a9a2946cbb01c00
                                costPrice: null
                                name: '😲 '
                                price: 2000
                                sale_price: null
                                stock: 20256
                              - _id: 6097fa2cdfb7de16f1cc398f
                                costPrice: null
                                name: Test prod
                                price: 9000
                                sale_price: 1200
                                stock: 10
                              - _id: 60aa6f6cb2d261083ec7591f
                                costPrice: null
                                name: Test TAG
                                price: 9000
                                sale_price: 0
                                stock: 10067
                          next:
                            type: number
                            example: 2
                          noOfPages:
                            type: number
                            example: 20
                          prev:
                            nullable: true
                            example: null
                          totalRecord:
                            type: number
                            example: 58
                      topCustomers:
                        type: object
                        properties:
                          currentPage:
                            type: number
                            example: 1
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                __v:
                                  type: number
                                  example: 0
                                _id:
                                  type: string
                                  example: 621771d3893b196f52e7a74b
                                created_at:
                                  type: string
                                  example: '2022-02-24T11:53:55.746Z'
                                fullName:
                                  nullable: true
                                  example: null
                                isClaimed:
                                  type: boolean
                                  example: false
                                numberOfOrders:
                                  type: number
                                  example: 0
                                orderTotal:
                                  type: number
                                  example: 0
                                roles:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      __v:
                                        type: number
                                        example: 0
                                      _id:
                                        type: string
                                        example: 5e7e8830872c2c0f8c1c3fb3
                                      isAdmin:
                                        type: boolean
                                        example: false
                                      isSuperAdmin:
                                        type: boolean
                                        example: false
                                      key:
                                        type: string
                                        example: shopper
                                      name:
                                        type: string
                                        example: Shopper
                                      type:
                                        type: string
                                        example: customer
                                  example:
                                    - __v: 0
                                      _id: 5e7e8830872c2c0f8c1c3fb3
                                      isAdmin: false
                                      isSuperAdmin: false
                                      key: shopper
                                      name: Shopper
                                      type: customer
                                shop:
                                  type: object
                                  properties:
                                    _id:
                                      type: string
                                      example: 5f439e2e64d89817e562a811
                                    domainActive:
                                      type: boolean
                                      example: true
                                    domainName:
                                      type: string
                                      example: louisanm.com
                                    name:
                                      type: string
                                      example: Pet store worldwide
                                    slug:
                                      type: string
                                      example: pet-store
                                    url:
                                      type: string
                                      example: https://louisanm.com
                                suspended:
                                  type: boolean
                                  example: false
                                suspendedRoles:
                                  type: array
                                  items: {}
                                  example: []
                                telephone:
                                  nullable: true
                                  example: null
                                updated_at:
                                  type: string
                                  example: '2022-02-24T11:53:55.746Z'
                                user:
                                  type: object
                                  properties:
                                    __v:
                                      type: number
                                      example: 0
                                    _id:
                                      type: string
                                      example: 621771d3893b196f52e7a74d
                                    address:
                                      type: object
                                      properties:
                                        _id:
                                          type: string
                                          example: 637b7f55c98fabffa247d85b
                                        line_1:
                                          type: string
                                          example: nnn
                                        line_2:
                                          type: string
                                          example: nn
                                        state:
                                          type: string
                                          example: Adamawa
                                        state_id:
                                          type: string
                                          example: 5ee6a281eea46308e8f84844
                                    addresses:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          _id:
                                            type: string
                                            example: 6336e0efc00bb5ff34d3379a
                                          line_1:
                                            type: string
                                            example: nnn
                                          line_2:
                                            type: string
                                            example: nn
                                          state:
                                            type: string
                                            example: Adamawa
                                          stateData:
                                            type: string
                                            example: 5ee6a281eea46308e8f84844
                                          state_id:
                                            type: string
                                            example: 5ee6a281eea46308e8f84844
                                      example:
                                        - _id: 6336e0efc00bb5ff34d3379a
                                          line_1: nnn
                                          line_2: nn
                                          state: Adamawa
                                          stateData: 5ee6a281eea46308e8f84844
                                          state_id: 5ee6a281eea46308e8f84844
                                    email:
                                      type: string
                                      example: treasurefun926@yahoo.com
                                    full_name:
                                      type: string
                                      example: Louisa girl
                                    isActivated:
                                      type: boolean
                                      example: true
                                    last_access:
                                      type: string
                                      example: '2022-02-24T12:30:41.560Z'
                                    profiles:
                                      type: array
                                      items:
                                        type: string
                                        example: 621771d3893b196f52e7a74b
                                      example:
                                        - 621771d3893b196f52e7a74b
                                    reg_date:
                                      type: string
                                      example: '2022-02-24T11:53:55.750Z'
                                    reset_pass:
                                      type: boolean
                                      example: false
                                    shopCount:
                                      type: number
                                      example: 0
                                    social:
                                      type: array
                                      items: {}
                                      example: []
                                    suspended:
                                      type: boolean
                                      example: false
                                    telephone:
                                      type: string
                                      example: '+2348137064736'
                                    test_user:
                                      type: boolean
                                      example: false
                                    username:
                                      type: string
                                      example: louisaoge938
                                    whatsapp:
                                      type: string
                                      example: '+2348137064736'
                            example:
                              - __v: 0
                                _id: 621771d3893b196f52e7a74b
                                created_at: '2022-02-24T11:53:55.746Z'
                                fullName: null
                                isClaimed: false
                                numberOfOrders: 0
                                orderTotal: 0
                                roles:
                                  - __v: 0
                                    _id: 5e7e8830872c2c0f8c1c3fb3
                                    isAdmin: false
                                    isSuperAdmin: false
                                    key: shopper
                                    name: Shopper
                                    type: customer
                                shop:
                                  _id: 5f439e2e64d89817e562a811
                                  domainActive: true
                                  domainName: louisanm.com
                                  name: Pet store worldwide
                                  slug: pet-store
                                  url: https://louisanm.com
                                suspended: false
                                suspendedRoles: []
                                telephone: null
                                updated_at: '2022-02-24T11:53:55.746Z'
                                user:
                                  __v: 0
                                  _id: 621771d3893b196f52e7a74d
                                  address:
                                    _id: 637b7f55c98fabffa247d85b
                                    line_1: nnn
                                    line_2: nn
                                    state: Adamawa
                                    state_id: 5ee6a281eea46308e8f84844
                                  addresses:
                                    - _id: 6336e0efc00bb5ff34d3379a
                                      line_1: nnn
                                      line_2: nn
                                      state: Adamawa
                                      stateData: 5ee6a281eea46308e8f84844
                                      state_id: 5ee6a281eea46308e8f84844
                                  email: treasurefun926@yahoo.com
                                  full_name: Louisa girl
                                  isActivated: true
                                  last_access: '2022-02-24T12:30:41.560Z'
                                  profiles:
                                    - 621771d3893b196f52e7a74b
                                  reg_date: '2022-02-24T11:53:55.750Z'
                                  reset_pass: false
                                  shopCount: 0
                                  social: []
                                  suspended: false
                                  telephone: '+2348137064736'
                                  test_user: false
                                  username: louisaoge938
                                  whatsapp: '+2348137064736'
                              - __v: 0
                                _id: 621771808eeb5f6e39ec7063
                                created_at: '2022-02-24T11:52:32.607Z'
                                fullName: null
                                isClaimed: false
                                numberOfOrders: 0
                                orderTotal: 0
                                roles:
                                  - __v: 0
                                    _id: 5e7e8830872c2c0f8c1c3fb3
                                    isAdmin: false
                                    isSuperAdmin: false
                                    key: shopper
                                    name: Shopper
                                    type: customer
                                shop:
                                  _id: 5f439e2e64d89817e562a811
                                  domainActive: true
                                  domainName: louisanm.com
                                  name: Pet store worldwide
                                  slug: pet-store
                                  url: https://louisanm.com
                                suspended: false
                                suspendedRoles: []
                                telephone: null
                                updated_at: '2022-02-24T11:52:32.607Z'
                              - __v: 0
                                _id: 621771af4950ec6e68f85b57
                                created_at: '2022-02-24T11:53:19.708Z'
                                fullName: null
                                isClaimed: false
                                numberOfOrders: 0
                                orderTotal: 0
                                roles:
                                  - __v: 0
                                    _id: 5e7e8830872c2c0f8c1c3fb3
                                    isAdmin: false
                                    isSuperAdmin: false
                                    key: shopper
                                    name: Shopper
                                    type: customer
                                shop:
                                  _id: 5f439e2e64d89817e562a811
                                  domainActive: true
                                  domainName: louisanm.com
                                  name: Pet store worldwide
                                  slug: pet-store
                                  url: https://louisanm.com
                                suspended: false
                                suspendedRoles: []
                                telephone: null
                                updated_at: '2022-02-24T11:53:19.708Z'
                          next:
                            type: number
                            example: 2
                          noOfPages:
                            type: number
                            example: 8
                          prev:
                            nullable: true
                            example: null
                          totalRecord:
                            type: number
                            example: 23
                  msg:
                    type: string
                    example: Revenue aggregation successful
                  success:
                    type: boolean
                    example: true
              examples:
                '200':
                  value:
                    data:
                      products:
                        currentPage: 1
                        data:
                          - _id: 60b5098f3a9a2946cbb01c00
                            costPrice: null
                            name: '😲 '
                            price: 2000
                            sale_price: null
                            stock: 20256
                          - _id: 6097fa2cdfb7de16f1cc398f
                            costPrice: null
                            name: Test prod
                            price: 9000
                            sale_price: 1200
                            stock: 10
                          - _id: 60aa6f6cb2d261083ec7591f
                            costPrice: null
                            name: Test TAG
                            price: 9000
                            sale_price: 0
                            stock: 10067
                        next: 2
                        noOfPages: 20
                        prev: null
                        totalRecord: 58
                      topCustomers:
                        currentPage: 1
                        data:
                          - __v: 0
                            _id: 621771d3893b196f52e7a74b
                            created_at: '2022-02-24T11:53:55.746Z'
                            fullName: null
                            isClaimed: false
                            numberOfOrders: 0
                            orderTotal: 0
                            roles:
                              - __v: 0
                                _id: 5e7e8830872c2c0f8c1c3fb3
                                isAdmin: false
                                isSuperAdmin: false
                                key: shopper
                                name: Shopper
                                type: customer
                            shop:
                              _id: 5f439e2e64d89817e562a811
                              domainActive: true
                              domainName: louisanm.com
                              name: Pet store worldwide
                              slug: pet-store
                              url: https://louisanm.com
                            suspended: false
                            suspendedRoles: []
                            telephone: null
                            updated_at: '2022-02-24T11:53:55.746Z'
                            user:
                              __v: 0
                              _id: 621771d3893b196f52e7a74d
                              address:
                                _id: 637b7f55c98fabffa247d85b
                                line_1: nnn
                                line_2: nn
                                state: Adamawa
                                state_id: 5ee6a281eea46308e8f84844
                              addresses:
                                - _id: 6336e0efc00bb5ff34d3379a
                                  line_1: nnn
                                  line_2: nn
                                  state: Adamawa
                                  stateData: 5ee6a281eea46308e8f84844
                                  state_id: 5ee6a281eea46308e8f84844
                              email: treasurefun926@yahoo.com
                              full_name: Louisa girl
                              isActivated: true
                              last_access: '2022-02-24T12:30:41.560Z'
                              profiles:
                                - 621771d3893b196f52e7a74b
                              reg_date: '2022-02-24T11:53:55.750Z'
                              reset_pass: false
                              shopCount: 0
                              social: []
                              suspended: false
                              telephone: '+2348137064736'
                              test_user: false
                              username: louisaoge938
                              whatsapp: '+2348137064736'
                          - __v: 0
                            _id: 621771808eeb5f6e39ec7063
                            created_at: '2022-02-24T11:52:32.607Z'
                            fullName: null
                            isClaimed: false
                            numberOfOrders: 0
                            orderTotal: 0
                            roles:
                              - __v: 0
                                _id: 5e7e8830872c2c0f8c1c3fb3
                                isAdmin: false
                                isSuperAdmin: false
                                key: shopper
                                name: Shopper
                                type: customer
                            shop:
                              _id: 5f439e2e64d89817e562a811
                              domainActive: true
                              domainName: louisanm.com
                              name: Pet store worldwide
                              slug: pet-store
                              url: https://louisanm.com
                            suspended: false
                            suspendedRoles: []
                            telephone: null
                            updated_at: '2022-02-24T11:52:32.607Z'
                          - __v: 0
                            _id: 621771af4950ec6e68f85b57
                            created_at: '2022-02-24T11:53:19.708Z'
                            fullName: null
                            isClaimed: false
                            numberOfOrders: 0
                            orderTotal: 0
                            roles:
                              - __v: 0
                                _id: 5e7e8830872c2c0f8c1c3fb3
                                isAdmin: false
                                isSuperAdmin: false
                                key: shopper
                                name: Shopper
                                type: customer
                            shop:
                              _id: 5f439e2e64d89817e562a811
                              domainActive: true
                              domainName: louisanm.com
                              name: Pet store worldwide
                              slug: pet-store
                              url: https://louisanm.com
                            suspended: false
                            suspendedRoles: []
                            telephone: null
                            updated_at: '2022-02-24T11:53:19.708Z'
                        next: 2
                        noOfPages: 8
                        prev: null
                        totalRecord: 23
                    msg: Revenue aggregation successful
                    success: true

````