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

# Profit and loss

> Returns a profit and loss for a date window, built live from TikTok's settlement statements. Each line (`groups[]` and `totals`) has `revenue`, `refunds`, `shipping`, `feesAndTaxes` with `fees` and `taxes` maps, `platformCommission`, `affiliateCommission`, `adjustments`, `adjustmentsByType`, `reserve` and `settlement`, plus row counts. Amounts are exact decimal strings in `currency`, summed with TikTok's own signs, so fees are negative. Reserves are kept out of `settlement`.

`start_date` and `end_date` are activity days, YYYY-MM-DD, UTC, both inclusive, at most 365 days apart. TikTok cuts one statement a day at 00:00 UTC covering the day before, so each activity day maps to the statement stamped the next day. `group_by` is `total` (default), `day` or `sku`. With `sku`, adjustments, reserves and orders that couldn't be read go to `unallocated`. A window whose statements are in more than one currency is rejected.

Large windows can be cut short. When `truncated` is true, `truncatedReasons` and `coverage` say what was left out, and `statements.headerTotals` still sums the header of every listed statement. Narrow the window to get full coverage.



## OpenAPI

````yaml api-reference/tik-tok-shop-openapi.json GET /tik_tok_shop/finance/pnl
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/finance/pnl:
    get:
      summary: Profit and loss
      description: >-
        Returns a profit and loss for a date window, built live from TikTok's
        settlement statements. Each line (`groups[]` and `totals`) has
        `revenue`, `refunds`, `shipping`, `feesAndTaxes` with `fees` and `taxes`
        maps, `platformCommission`, `affiliateCommission`, `adjustments`,
        `adjustmentsByType`, `reserve` and `settlement`, plus row counts.
        Amounts are exact decimal strings in `currency`, summed with TikTok's
        own signs, so fees are negative. Reserves are kept out of `settlement`.


        `start_date` and `end_date` are activity days, YYYY-MM-DD, UTC, both
        inclusive, at most 365 days apart. TikTok cuts one statement a day at
        00:00 UTC covering the day before, so each activity day maps to the
        statement stamped the next day. `group_by` is `total` (default), `day`
        or `sku`. With `sku`, adjustments, reserves and orders that couldn't be
        read go to `unallocated`. A window whose statements are in more than one
        currency is rejected.


        Large windows can be cut short. When `truncated` is true,
        `truncatedReasons` and `coverage` say what was left out, and
        `statements.headerTotals` still sums the header of every listed
        statement. Narrow the window to get full coverage.
      parameters:
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date
          description: First activity day, YYYY-MM-DD, UTC, inclusive.
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date
          description: >-
            Last activity day, YYYY-MM-DD, UTC, inclusive. At most 365 days
            after start_date.
        - name: group_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - total
              - day
              - sku
            default: total
          description: 'total, day (activity day: statement UTC date minus one) or sku.'
        - 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: >-
            { window, basis: statement_activity_day_utc, groupBy, currency,
            groups: [{ key, ...line }], totals: line, unallocated: line | null,
            statements: { listed, fullyRead, headerTotals }, coverage: {
            statementPages, transactionPages, transactionRows, statementsFailed,
            ordersNeeded, ordersRead, ordersFailed }, truncated,
            truncatedReasons, skusWithoutCogs }. line = { revenue,
            revenueBreakdown, refunds, shipping, shippingBreakdown,
            feesAndTaxes, fees, taxes, platformCommission, affiliateCommission,
            adjustments, adjustmentsByType, reserve, settlement, rows: { orders,
            adjustments, reserves, skus }, units, cogs, grossProfit }.
          content:
            application/json:
              example:
                window:
                  startDate: '2026-09-01'
                  endDate: '2026-09-01'
                basis: statement_activity_day_utc
                groupBy: total
                currency: USD
                groups:
                  - key: total
                    revenue: '120.00'
                    revenueBreakdown:
                      subtotalBeforeDiscountAmount: '130.00'
                      sellerDiscountAmount: '-10.00'
                    refunds:
                      refundSubtotalBeforeDiscountAmount: '0'
                      sellerDiscountRefundAmount: '0'
                    shipping: '-6.00'
                    shippingBreakdown:
                      actualShippingFeeAmount: '-6.00'
                    feesAndTaxes: '-9.70'
                    fees:
                      platformCommissionAmount: '-3.20'
                      affiliateCommissionAmount: '-4.00'
                      referralFeeAmount: '-2.40'
                    taxes:
                      salesTaxReferralFeeAmount: '-0.10'
                    platformCommission: '-3.20'
                    affiliateCommission: '-4.00'
                    adjustments: '0'
                    adjustmentsByType: {}
                    reserve: '0'
                    settlement: '104.30'
                    rows:
                      orders: 1
                      adjustments: 0
                      reserves: 0
                      skus: 0
                    units: '2'
                    cogs:
                      amount: '25.00'
                      units: '2'
                      unitsCosted: '2'
                      complete: true
                    grossProfit: '79.30'
                unallocated: null
                statements:
                  listed: 1
                  fullyRead: 1
                  headerTotals:
                    settlementAmount: '104.30'
                    revenueAmount: '120.00'
                    feeAmount: '-9.70'
                    shippingCostAmount: '-6.00'
                    adjustmentAmount: '0'
                    netSalesAmount: '120.00'
                coverage:
                  statementPages: 1
                  transactionPages: 1
                  transactionRows: 1
                  statementsFailed: 0
                  ordersNeeded: 1
                  ordersRead: 1
                  ordersFailed: 0
                truncated: false
                truncatedReasons: []
                skusWithoutCogs: []
        '400':
          description: >-
            Invalid params: missing or malformed dates, a reversed window or one
            over 365 days, an unknown group_by, or statements in more than one
            currency in the window
          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.