---
title: "Referral Graph Data"
method: GET
path: "/organization/referral-graph-data/{organization_id}/"
tags: ["organization"]
---

# Referral Graph Data

`GET /organization/referral-graph-data/{organization_id}/`

Get graph data for referral program metrics over time.

Supports the following report types:
- TOTAL_REFERRAL_ORDERS: Count of orders with referral codes over time
- TOTAL_REFERRAL_COMMISSION: Total commission earned over time
- TOTAL_REFERRAL_TICKETS: Number of tickets sold through referrals over time
- TOTAL_REFERRAL_REVENUE: Total revenue from referrals over time (without service fees)

Supports the following filter types:
- MONTHLY: Filter by a specific month (requires 'month' parameter, e.g., "January")
- CUSTOM: Filter by custom date range (requires 'start_date' and 'end_date' in YYYY-MM-DD format)
- YEARLY: Group by months for a specific year (requires 'year' parameter, e.g., "2024")

Query Parameters:
- report_type: Type of report (default: "TOTAL REFERRAL ORDERS")
- filter_type: Filter type (MONTHLY, CUSTOM, YEARLY)
- start_date: Start date for CUSTOM filter (YYYY-MM-DD)
- end_date: End date for CUSTOM filter (YYYY-MM-DD)
- month: Month name for MONTHLY filter (e.g., "January", "February")
- year: Year for YEARLY filter (e.g., "2024")

Returns:
Dictionary with dates as keys and counts/amounts as values.
For MONTHLY and CUSTOM: {"01 January, 2024": 5, "02 January, 2024": 3, ...}
For YEARLY: {"January, 2024": 25, "February, 2024": 30, ...}

## Path parameters

- `organization_id` integer, required

## Query parameters

- `report_type` string, nullable
- `filter_type` string, nullable
- `start_date` string, nullable
- `end_date` string, nullable
- `month` string, nullable
- `year` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `404` — Not found
- `422` — Validation Error

---

[API](https://skmtc.dev/myticketpartner/apis/fastapi.md) · [All operations](https://skmtc.dev/myticketpartner/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/myticketpartner/fastapi/revisions/b574a0cabefe/schema)
