---
title: "Generate referral link"
method: POST
path: "/referral/generate"
tags: ["referral"]
---

# Generate referral link

`POST /referral/generate`

Generate a referral link for a member. The backend automatically handles:
    - Device OS detection (Android/iOS/Desktop)
    - App installation detection via Universal Links (iOS) and App Links (Android)
    - Redirect to App Store/Play Store if app is not installed
    - Opens app directly with member ID parameter if installed
    
    **Usage:**
    - Mobile app calls this endpoint with memberID
    - Returns referral link that can be shared
    - When clicked, backend detects device type and handles redirect
    - Seamlessly redirects to store or opens app via deep linking

## Request body

- GenerateReferralLinkDto
  - `memberID` string, required — Member ID of the referrer (e.g., TWE-123456)

## Response `200`

Referral link generated successfully

- GenerateReferralLinkResponseDto
  - `success` boolean, required — Success status
  - `message` string, required — Response message
  - `data` object, required — Referral link data

## Other responses

- `400` — Invalid member ID format

---

[API](https://skmtc.dev/tonewow/apis/tonewow-database-api.md) · [All operations](https://skmtc.dev/tonewow/apis/tonewow-database-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tonewow/tonewow-database-api/revisions/f36472974ad4/schema)
