---
title: "Create affiliate"
method: POST
path: "/affiliates"
tags: ["Affiliates"]
---

# Create affiliate

`POST /affiliates`

## Request

- Base URL: `https://refgrow.com/api/v1`
- URL: `https://refgrow.com/api/v1/affiliates`
- Auth: HTTP bearer

## Request body

- CreateAffiliateBody
  - `email` string, email, required
  - `referral_code` string: Auto-generated if omitted
  - `partner_slug` string
  - `payment_method` string: Free-text, e.g. 'PayPal', 'USDT TRC-20'
  - `payment_details` string: Free-text wallet / email / IBAN

## Response `201`

Affiliate created. Triggers `affiliate.created` webhook.

- object
  - `success` boolean
  - `data` Affiliate
    - `id` integer
    - `user_email` string, email
    - `referral_code` string
    - `partner_slug` string, nullable
    - `status` 'active' | 'inactive' | 'pending' | 'suspended'
    - `clicks` integer
    - `signups` integer
    - `purchases` integer
    - `total_earnings` string
    - `unpaid_earnings` string
    - `payment_method` string, nullable
    - `payment_details` string, nullable
    - `created_at` string, date-time

## Other responses

- `400`: Validation failed
- `401`: Missing or invalid Bearer key
- `409`: Duplicate (email or code already exists)

---

[API](https://skmtc.dev/refgrow/apis/refgrow-api.md) - [All operations](https://skmtc.dev/refgrow/apis/refgrow-api/llms.txt) - [OpenAPI document](https://skmtc.dev/refgrow/apis/refgrow-api/revisions/68cce63d08d2?raw)
