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

> Returns TikTok's diagnosis of one Shop Performance Score metric: its value, score, status and benchmarks, a daily `trend`, the `calculation` behind it (numerator and denominator with labels), how its problem cases split in `distribution`, and TikTok's diagnostic text in `analyses` (empty when TikTok has none).

`metricCode` is case-insensitive. Current codes are `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) and `IM_DSAT` (chat dissatisfaction rate). TikTok may add more. `trend_duration_days` sets the trend length, 1 to 365, default 30. US shops only. Read live from TikTok.



## OpenAPI

````yaml api-reference/tik-tok-shop-openapi.json GET /tik_tok_shop/shop_health/metrics/{metricCode}
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}:
    get:
      summary: Metric diagnosis
      description: >-
        Returns TikTok's diagnosis of one Shop Performance Score metric: its
        value, score, status and benchmarks, a daily `trend`, the `calculation`
        behind it (numerator and denominator with labels), how its problem cases
        split in `distribution`, and TikTok's diagnostic text in `analyses`
        (empty when TikTok has none).


        `metricCode` is case-insensitive. Current codes are `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) and `IM_DSAT` (chat dissatisfaction rate).
        TikTok may add more. `trend_duration_days` sets the trend length, 1 to
        365, default 30. 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: trend_duration_days
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 365
          description: >-
            Days of trend to return. Absent = TikTok's default, 30. TikTok
            documents no maximum; the 365 cap only keeps junk out.
        - 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 metric diagnosis
          content:
            application/json:
              schema:
                type: object
                properties:
                  metricCode:
                    type: string
                    nullable: true
                  dimension:
                    type: string
                    nullable: true
                  score:
                    type: string
                    nullable: true
                    description: 0 to 5, TikTok's decimal string.
                  status:
                    type: string
                    nullable: true
                    description: >-
                      EXCELLENT | GOOD | POOR | CRITICAL | NIL. NIL means this
                      metric has not enough data to be scored; it is not a zero
                      score.
                  statusText:
                    type: string
                    nullable: true
                  value:
                    type: string
                    nullable: true
                    description: TikTok's decimal string, in valueUnit.
                  valueUnit:
                    type: string
                    nullable: true
                    description: PERCENT or HOURS.
                  benchmarks:
                    type: object
                    nullable: true
                    description: >-
                      TikTok's own tier thresholds for this metric, in the same
                      unit as value. Higher is better for OTDR, lower is better
                      for the others.
                    properties:
                      excellentThreshold:
                        type: string
                        nullable: true
                      poorThreshold:
                        type: string
                        nullable: true
                  evaluateDurationDays:
                    type: integer
                    nullable: true
                  evaluationStartsAt:
                    type: string
                    nullable: true
                    format: date-time
                  evaluationEndsAt:
                    type: string
                    nullable: true
                    format: date-time
                  trend:
                    type: array
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                          nullable: true
                          description: YYYY-MM-DD.
                        value:
                          type: string
                          nullable: true
                          description: Same unit as valueUnit.
                  calculation:
                    type: object
                    nullable: true
                    properties:
                      numeratorLabel:
                        type: string
                        nullable: true
                      numeratorValue:
                        type: string
                        nullable: true
                      denominatorLabel:
                        type: string
                        nullable: true
                      denominatorValue:
                        type: string
                        nullable: true
                  distribution:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          nullable: true
                        count:
                          type: integer
                          nullable: true
                        percent:
                          type: string
                          nullable: true
                          description: 0 to 100.
                  analyses:
                    type: array
                    items:
                      type: object
                      properties:
                        summaries:
                          type: array
                          items:
                            type: string
                        details:
                          type: array
                          items:
                            type: string
              example:
                metricCode: OTDR
                dimension: Fulfillment and logistics
                score: '4.1'
                status: GOOD
                statusText: Good
                value: '94.7'
                valueUnit: PERCENT
                benchmarks:
                  excellentThreshold: '95'
                  poorThreshold: '85'
                evaluateDurationDays: 30
                evaluationStartsAt: '2026-08-30T00:00:00.000Z'
                evaluationEndsAt: '2026-09-29T00:00:00.000Z'
                trend:
                  - date: '2026-09-27'
                    value: '94.1'
                  - date: '2026-09-28'
                    value: '94.7'
                calculation:
                  numeratorLabel: On-time delivered orders
                  numeratorValue: '947'
                  denominatorLabel: Delivered orders
                  denominatorValue: '1000'
                distribution:
                  - name: Carrier delay
                    count: 30
                    percent: '56.6'
                analyses: []
        '400':
          description: 'Invalid params: metric code or query value'
          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.