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

# List report files

> Returns one entry for each UTC day in [start_date, end_date] that has a file, in date order, each with a signed GET link to that day's file. A day with no transactions still has a file, with no rows. A day with no entry is a day the export has not written yet, such as the current UTC day or a day whose export is late; it does not mean the day had no transactions, so call again later for that day. Days before first_date never get a file, because the shop's export of that type and format started on first_date. A shop that has no file of the requested type and format on any day gets FAILED_PRECONDITION instead. Stash turns a shop's export on, and it writes the first file, before the partner is told that the report is available; so this error means the report is not available for the shop yet: do not retry, contact Stash. The files use the same columns as the transaction reports in Stash Studio. Each row is one event: a payment, a refund or a dispute step. A later refund or dispute step is a new row on its own day; it does not change the payment's row. The record_id column is a stable ID of the event: the same event has the same record_id in every file. Use it to remove rows that two pulls share, and keep the row from the later pull. Columns are added only at the end, and a column is renamed or removed only with advance notice, so read the files by column name, not by position. A SETTLED day that is not final can still change; pull it again until is_final is true. SETTLED days become final together with their UTC calendar month, when Stash closes the month, usually 1 to 5 days after it ends. CHARGE days are never final, because their rows change while their charges settle, so do not wait for is_final on a CHARGE day. Stash gives no stop signal for a CHARGE day: follow it for as long as you need its unsettled rows, and use SETTLED for figures that become final. To know when to download a day again, compare its content_hash with the copy you hold: every change to the file's bytes gives a new content_hash, and the same bytes always give the same content_hash. as_of is the time of the data snapshot that each file was written from. Every link is valid until download_url_expires_at, 15 minutes after the response; call again for fresh links. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. The shop in the signature header must equal the shop_id in the path. Repeated calls are safe, so retry after UNAVAILABLE or a timeout with a fresh timestamp and signature. Returns HTTP 401 (UNAUTHENTICATED) when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop or one Stash does not know; HTTP 400 (INVALID_ARGUMENT) when report_type or report_format is unspecified or unknown, a date is missing or is not YYYY-MM-DD, end_date is before start_date, or the range is longer than 31 days; HTTP 400 (FAILED_PRECONDITION) when the shop has no file of the requested type and format on any day; and HTTP 503 (UNAVAILABLE) when the files could not be listed, in which case retry. The two HTTP 400 cases differ only by the code in the response body: 3 for INVALID_ARGUMENT, 9 for FAILED_PRECONDITION. Do not retry UNAUTHENTICATED or INVALID_ARGUMENT unchanged: correct the signature or the request first, then send it again with a fresh timestamp and signature.



## OpenAPI

````yaml /ingress-openapi.json post /sdk/studio/{shopId}/reports/files
openapi: 3.0.0
info:
  title: Stash API
  description: >-
    Set of APIs for integrating Stash functionality into games. API set includes
    authentication, payment processing, checkout links, user management, and
    various platform-specific integrations. The API supports both client-side
    and server-side implementations with appropriate security measures for each
    context.
  version: '1.0'
servers:
  - url: https://test-api.stash.gg
security: []
tags:
  - name: Catalog
    description: >-
      Server-side catalog endpoints for shops with a real-time catalog
      integration.
  - name: Launcher Payment
    description: Payment processing endpoints for Stash Launcher.
  - name: Subscription Checkout Links
    description: Checkout link generation for subscription purchases
  - name: Webshop Account Linking
    description: >-
      Authentication endpoints for integrating third-party login providers or
      custom login with Stash Webshops.
  - name: Payments
    description: Payment history and transaction management endpoints
  - name: Pricing
    description: Server-side pricing endpoints for fetching uploaded price sheet data
  - name: Stash Pay
    description: Server-side quick payment endpoints for internal use
  - name: Web Shop
    description: Server-side endpoints that control your web shop.
  - name: Subscription Plans
    description: Retrieve subscription plan details and pricing
  - name: Subscriptions
    description: Manage player subscriptions - retrieve, cancel, and reactivate
  - name: Server URLs
    description: Server-side URL generation endpoints for authenticated URLs
  - name: User Preferences
    description: User preferences management endpoints for payment channel preferences
  - name: Loyalty
    description: >-
      Endpoints for reading a shop's loyalty program and, for enabled shops,
      configuring it
  - name: Localization
    description: >-
      Endpoints for refreshing a shop's localizations from its localization
      source
  - name: Reports
    description: >-
      Endpoints for listing a shop's daily transaction files and downloading
      them through signed links
paths:
  /sdk/studio/{shopId}/reports/files:
    post:
      tags:
        - Reports
      summary: List report files
      description: >-
        Returns one entry for each UTC day in [start_date, end_date] that has a
        file, in date order, each with a signed GET link to that day's file. A
        day with no transactions still has a file, with no rows. A day with no
        entry is a day the export has not written yet, such as the current UTC
        day or a day whose export is late; it does not mean the day had no
        transactions, so call again later for that day. Days before first_date
        never get a file, because the shop's export of that type and format
        started on first_date. A shop that has no file of the requested type and
        format on any day gets FAILED_PRECONDITION instead. Stash turns a shop's
        export on, and it writes the first file, before the partner is told that
        the report is available; so this error means the report is not available
        for the shop yet: do not retry, contact Stash. The files use the same
        columns as the transaction reports in Stash Studio. Each row is one
        event: a payment, a refund or a dispute step. A later refund or dispute
        step is a new row on its own day; it does not change the payment's row.
        The record_id column is a stable ID of the event: the same event has the
        same record_id in every file. Use it to remove rows that two pulls
        share, and keep the row from the later pull. Columns are added only at
        the end, and a column is renamed or removed only with advance notice, so
        read the files by column name, not by position. A SETTLED day that is
        not final can still change; pull it again until is_final is true.
        SETTLED days become final together with their UTC calendar month, when
        Stash closes the month, usually 1 to 5 days after it ends. CHARGE days
        are never final, because their rows change while their charges settle,
        so do not wait for is_final on a CHARGE day. Stash gives no stop signal
        for a CHARGE day: follow it for as long as you need its unsettled rows,
        and use SETTLED for figures that become final. To know when to download
        a day again, compare its content_hash with the copy you hold: every
        change to the file's bytes gives a new content_hash, and the same bytes
        always give the same content_hash. as_of is the time of the data
        snapshot that each file was written from. Every link is valid until
        download_url_expires_at, 15 minutes after the response; call again for
        fresh links. This method accepts only the versioned
        x-stash-hmac-signature header, signed over the request body exactly as
        sent; the legacy stash-hmac-signature header is rejected with HTTP 401
        (UNAUTHENTICATED), because it carries no timestamp and a captured
        request could be replayed. The shop in the signature header must equal
        the shop_id in the path. Repeated calls are safe, so retry after
        UNAVAILABLE or a timeout with a fresh timestamp and signature. Returns
        HTTP 401 (UNAUTHENTICATED) when the signature is missing, invalid,
        outside the time window, sent in the legacy header, or names a different
        shop or one Stash does not know; HTTP 400 (INVALID_ARGUMENT) when
        report_type or report_format is unspecified or unknown, a date is
        missing or is not YYYY-MM-DD, end_date is before start_date, or the
        range is longer than 31 days; HTTP 400 (FAILED_PRECONDITION) when the
        shop has no file of the requested type and format on any day; and HTTP
        503 (UNAVAILABLE) when the files could not be listed, in which case
        retry. The two HTTP 400 cases differ only by the code in the response
        body: 3 for INVALID_ARGUMENT, 9 for FAILED_PRECONDITION. Do not retry
        UNAUTHENTICATED or INVALID_ARGUMENT unchanged: correct the signature or
        the request first, then send it again with a fresh timestamp and
        signature.
      operationId: ListReportFiles
      parameters:
        - name: shopId
          description: >-
            Shop identifier from Stash Studio. Must equal the shop in the
            x-stash-hmac-signature header.
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/server.ingress.reports.v1.ReportService.ListReportFilesBody
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/server.ingress.reports.v1.ListReportFilesResponse
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      security:
        - hmac: []
components:
  schemas:
    server.ingress.reports.v1.ReportService.ListReportFilesBody:
      type: object
      properties:
        reportType:
          $ref: '#/components/schemas/server.ingress.reports.v1.ReportType'
        reportFormat:
          $ref: '#/components/schemas/server.ingress.reports.v1.ReportFormat'
        startDate:
          type: string
          description: >-
            First UTC day of the range, inclusive, as YYYY-MM-DD. The range
            [start_date, end_date] is at most 31 days.
        endDate:
          type: string
          description: >-
            Last UTC day of the range, inclusive, as YYYY-MM-DD. Must not be
            before start_date.
      description: >-
        Request to list a shop's report files for a range of UTC days. The shop
        is taken from the path. Signed over the request body exactly as sent.
      title: List Report Files Request
      required:
        - reportType
        - reportFormat
        - startDate
        - endDate
    server.ingress.reports.v1.ListReportFilesResponse:
      type: object
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.reports.v1.ReportFile'
          description: >-
            One entry for each day in the range that has a file, in date order.
            A day with no transactions has an entry whose file has no
            transaction rows: a CSV file still has its header row, and a JSONL
            file is 0 bytes. A day before first_date, or a day the export has
            not written yet, has no entry.
        downloadUrlExpiresAt:
          type: string
          format: date-time
          description: >-
            When every download_url in this response stops working (RFC 3339,
            UTC), 15 minutes after the response. Set on every successful
            response, also when files is empty.
        firstDate:
          type: string
          description: >-
            The first UTC day, as YYYY-MM-DD, that has a file of the requested
            type and format for the shop, even when it is outside the range.
            Days before it never get a file; a later day with no entry is not
            written yet.
      description: >-
        The shop's report files for the requested days, with one signed link
        each.
      title: List Report Files Response
      required:
        - downloadUrlExpiresAt
        - firstDate
    google.rpc.Status:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Any'
    server.ingress.reports.v1.ReportType:
      type: string
      enum:
        - REPORT_TYPE_UNSPECIFIED
        - REPORT_TYPE_SETTLED
        - REPORT_TYPE_CHARGE
      default: REPORT_TYPE_UNSPECIFIED
      description: |2-
         - REPORT_TYPE_UNSPECIFIED: Refused with INVALID_ARGUMENT.
         - REPORT_TYPE_SETTLED: One file per UTC settlement day; rows are dated by settlement and reconcile with the payout.
         - REPORT_TYPE_CHARGE: One file per UTC day. Each row is dated by its own Transaction Date: a payment by its charge time, a refund or
        dispute step by its own time. Includes unsettled and failed charges.
    server.ingress.reports.v1.ReportFormat:
      type: string
      enum:
        - REPORT_FORMAT_UNSPECIFIED
        - REPORT_FORMAT_CSV
        - REPORT_FORMAT_JSONL
        - REPORT_FORMAT_PARQUET
      default: REPORT_FORMAT_UNSPECIFIED
      description: >-
        The file format of a report file. Every format holds the same rows and
        columns.

         - REPORT_FORMAT_UNSPECIFIED: Refused with INVALID_ARGUMENT.
         - REPORT_FORMAT_CSV: Comma-separated values with a header row.
         - REPORT_FORMAT_JSONL: JSON Lines: one JSON object per row. A field with no value is left out of
        the object, not written as null.
         - REPORT_FORMAT_PARQUET: Apache Parquet.
    server.ingress.reports.v1.ReportFile:
      type: object
      properties:
        date:
          type: string
          description: The UTC day the file holds, as YYYY-MM-DD.
        isFinal:
          type: boolean
          description: >-
            true when the day's rows are final and no longer change: a SETTLED
            day becomes final when Stash closes its UTC calendar month. false
            for a SETTLED day while its rows can still change; pull the day
            again later. Always false for CHARGE, which never becomes final: do
            not wait for true on a CHARGE day. Always sent, including false.
        sizeBytes:
          type: string
          format: uint64
          description: >-
            Size of the file in bytes, never negative. Always sent, including 0
            for an empty file. JSON carries it as a decimal string.
        downloadUrl:
          type: string
          description: >-
            Signed GET link to the day's file. Valid until
            download_url_expires_at.
        asOf:
          type: string
          format: date-time
          description: >-
            The report cut: the time of the source data snapshot that the file
            was written from (RFC 3339, UTC). Every row in the file comes from
            that snapshot. Absent for a file the export wrote before it recorded
            its snapshot time.
        contentHash:
          type: string
          description: >-
            An opaque hash of the file's bytes. Every change to the file's bytes
            gives a new value, and the same bytes always give the same value, so
            download a day again exactly when its content_hash differs from the
            copy you hold.
      description: One day's report file and a signed link to download it.
      title: Report File
      required:
        - date
        - isFinal
        - sizeBytes
        - downloadUrl
        - contentHash
    google.protobuf.Any:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
  securitySchemes:
    hmac:
      type: apiKey
      description: >-
        Versioned HMAC-SHA256 signature authenticating server-to-server SDK
        requests (your backend calling Stash), as opposed to client-side SDK
        operations. Recommended over the deprecated X-Stash-Api-Key for the best
        security. Header format:
        v1;{appId};{unixMillisTimestamp};{base64Signature}
        (semicolon-delimited). {base64Signature} is the base64-encoded
        HMAC-SHA256 of the string {unixMillisTimestamp}.{requestBody} using your
        app ingress secret (the ingress secret is shown base64-encoded in
        Studio; base64-decode it to the raw bytes used as the HMAC key), where
        {requestBody} is the request body exactly as you send it for POST and
        PUT requests (the compact canonical request JSON is also accepted) and
        empty for GET requests. A signature over the exact bytes verifies for
        bodies of up to 18 KiB (18,432 bytes); a larger body may be refused with
        401 even when correctly signed. The timestamp must be within 5 minutes
        of Stash server time. Your appId is your immutable app identifier, shown
        in Stash Studio under Project Settings > App details; your ingress
        secret is under Project Settings > API Secrets.
      name: x-stash-hmac-signature
      in: header

````

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