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

# Metric top items

> Lists the items behind one Shop Performance Score metric. `itemType` says what the rows are: `products` for `NRR` and `NBFR`, `logistics_providers` for `OTDR`, and `aftersales_types` for `AHT`. A metric TikTok adds later comes back as `unknown`. Rows use camelCase keys from TikTok's fields, for example `productId`, `productName`, `deliveredOrderCount`, `negativeOrderCount` and `topReviewReasons` for products.

The list isn't paged. TikTok has no top items for `SFCR` or `IM_DSAT`, so those codes are rejected; use Metric problem details for them. US shops only. Read live from TikTok.



## OpenAPI

````yaml api-reference/tik-tok-shop-openapi.json GET /tik_tok_shop/shop_health/metrics/{metricCode}/top_items
openapi: 3.0.3
info:
  title: 'Growi API: TikTok Shop'
  version: 1.0.0
  description: >-
    Generated by scripts/gen_tik_tok_shop.rb from Growi's TikTok Shop route
    table.
servers:
  - url: https://api.growi.io/api/public/v1
security:
  - bearerAuth: []
paths:
  /tik_tok_shop/shop_health/metrics/{metricCode}/top_items:
    get:
      summary: Metric top items
      description: >-
        Lists the items behind one Shop Performance Score metric. `itemType`
        says what the rows are: `products` for `NRR` and `NBFR`,
        `logistics_providers` for `OTDR`, and `aftersales_types` for `AHT`. A
        metric TikTok adds later comes back as `unknown`. Rows use camelCase
        keys from TikTok's fields, for example `productId`, `productName`,
        `deliveredOrderCount`, `negativeOrderCount` and `topReviewReasons` for
        products.


        The list isn't paged. TikTok has no top items for `SFCR` or `IM_DSAT`,
        so those codes are rejected; use Metric problem details for them. US
        shops only. Read live from TikTok.
      parameters:
        - name: metricCode
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z][A-Za-z0-9_]{1,31}$
            example: NRR
          description: >-
            SPS metric code, case-insensitive. TikTok's codes today: NRR
            (negative review rate), NBFR (non-buyer-fault return and refund
            rate), SFCR (seller-fault cancellation rate), OTDR (on-time delivery
            rate), AHT (after-sales handling time), IM_DSAT (chat
            dissatisfaction rate). TikTok says the list may grow, so other
            code-shaped values pass through.
        - name: locale
          in: query
          required: false
          schema:
            type: string
            pattern: ^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$
            example: en-US
          description: >-
            Passed to TikTok to localize names and texts. Absent = TikTok picks
            the default.
        - name: organization_id
          in: query
          required: false
          schema:
            type: integer
          description: >-
            Use the TikTok Shop of this child brand (organization id) of your
            API key's organization
      responses:
        '200':
          description: The top items
          content:
            application/json:
              schema:
                type: object
                required:
                  - metricCode
                  - itemType
                  - items
                properties:
                  metricCode:
                    type: string
                  itemType:
                    type: string
                    enum:
                      - products
                      - logistics_providers
                      - aftersales_types
                      - unknown
                  totalCount:
                    type: integer
                    nullable: true
                  items:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                      description: >-
                        One row, camelCase keys from TikTok's fields. Ids are
                        strings, counts integers, rates and durations TikTok's
                        decimal strings, `*Time` fields ISO-8601 instants,
                        reasons string arrays.
              example:
                metricCode: NRR
                itemType: products
                totalCount: 1
                items:
                  - productId: '1729384756102938475'
                    productName: Ceramic mug
                    imageUrl: https://p16-oec-va.ibyteimg.com/example.jpg
                    deliveredOrderCount: 420
                    negativeOrderCount: 9
                    topReviewReasons:
                      - Not as described
        '400':
          description: >-
            Invalid params: metric code or query value, or SFCR / IM_DSAT
            (TikTok has no top items for them)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokShopError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokShopError'
        '403':
          description: >-
            The shop's TikTok authorization doesn't include this data (`code:
            scope_not_granted`), so the seller has to re-authorize the shop
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokShopError'
        '404':
          description: >-
            `organization_id` isn't an active child brand of your organization,
            or the record you asked for doesn't exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokShopError'
        '422':
          description: >-
            No TikTok Shop is connected for this organization. A parent
            organization whose shops sit on its child brands has to pass
            `organization_id`. Also returned when the shop isn't connected
            through TikTok's official API (`code: unsupported_on_web_only_shop`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokShopError'
        '429':
          description: >-
            Rate limited: one call every 2 seconds and an hourly cap per API
            key. See `Retry-After` and the `X-RateLimit-*` headers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokShopError'
        '502':
          description: >-
            TikTok refused or failed. `error` is a fixed message and `code`
            names the failure when there is one
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokShopError'
components:
  schemas:
    TikTokShopError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: What went wrong
        code:
          type: string
          description: Machine-readable reason, when there is one
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.