---
title: "Attach a referral to a user (public)"
method: POST
path: "/api/v1/visa/affiliate/apply-referral"
tags: ["Affiliate program"]
---

# Attach a referral to a user (public)

`POST /api/v1/visa/affiliate/apply-referral`

## Request

- Base URL: `https://visa.orizn.app`
- URL: `https://visa.orizn.app/api/v1/visa/affiliate/apply-referral`
- Auth: none required
- TypeScript: <https://skmtc.dev/orizn/apis/orizn-visa-api/docs/api/v1/visa/affiliate/apply-referral/post.ts> (a function with typed inputs; its response is checked against the schema)

Bind an existing user to a referrer after sign-up. Sets referred_by;
the referrer earns 15% on the user's future subscriptions.

## Request body

- object
  - `referral_code` string, required
  - `email` string, email, required

## Response `200`

Referral applied.

- object
  - `ok` boolean
  - `message` string
  - `referred_by` string

## Other responses

- `400`: Missing or malformed parameter.
- `404`: No data for the requested resource.

---

[API](https://skmtc.dev/orizn/apis/orizn-visa-api.md) - [All operations](https://skmtc.dev/orizn/apis/orizn-visa-api/llms.txt) - [OpenAPI document](https://skmtc.dev/orizn/apis/orizn-visa-api/revisions/7d2f2bc68d08?raw)
