---
title: "Generate a report"
method: POST
path: "/v1/report"
tags: ["Reports"]
---

# Generate a report

`POST /v1/report`

Generate a report of clicks, transactions, or commissions for a given date range. Supports JSON and CSV output formats.

## Request body

- ReportRequest
  - `start_date` string, date, required — Start date for the report period (YYYY-MM-DD).
  - `end_date` string, date, required — End date for the report period (YYYY-MM-DD).
  - `type` 'clicks' | 'transactions' | 'commissions', required — Report type.
  - `format` 'json' | 'csv' — Response format. Defaults to `"json"`.

## Response `200`

Report generated successfully. Returns JSON by default, or a CSV file when `format` is `"csv"`.

- ReportResponse
  - `report_id` string, required — Unique report identifier.
  - `type` 'clicks' | 'transactions' | 'commissions', required — Report type.
  - `start_date` string, date, required — Report start date.
  - `end_date` string, date, required — Report end date.
  - `total_records` integer, required — Number of records in the report.
  - `data` union[], required — Report rows. Shape varies by report type.
    - union
      - ClickRow
        - `date` string — Click timestamp (ISO 8601).
        - `brand` string — Store / brand name.
        - `store_slug` string — Store slug.
        - `click_id` string — Internal click ID.
        - `publisher_click_id` string, nullable — Your click ID (if provided).
        - `ip_address` string, nullable — Visitor IP address.
        - `referrer` string, nullable — HTTP referrer.
      - TransactionRow
        - `transaction_id` string — Unique transaction identifier. Stable across requests — use this as a dedup key.
        - `date` string — Transaction event date.
        - `brand` string — Merchant / brand name.
        - `amount` number — Sale amount.
        - `commission` number — Commission you earned, after your commission share (split) has been applied.
        - `status` string — Transaction status.
        - `order_number` string, nullable — Merchant order reference.
        - `currency` string — ISO 4217 currency code.
        - `publisher_click_id` string, nullable — Your click ID associated with the transaction, if provided at click time.
      - CommissionRow
        - `date` string — Transaction event date.
        - `brand` string — Merchant / brand name.
        - `amount` number — Sale amount.
        - `commission` number — Commission you earned, after your commission share (split) has been applied.
        - `status` string — Transaction status.
        - `currency` string — ISO 4217 currency code.

## Other responses

- `400` — Validation error — missing or invalid fields.
- `401` — Invalid or missing API key.

---

[API](https://skmtc.net/cashbackhive/apis/cashbackhive-publisher-api.md) · [All operations](https://skmtc.net/cashbackhive/apis/cashbackhive-publisher-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cashbackhive/cashbackhive-publisher-api/revisions/4e64b163cbe4/schema)
