> ## Documentation Index
> Fetch the complete documentation index at: https://docs.partnero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create referral link

> Create a new referral link for a partner

## Endpoint

```
POST https://api.partnero.com/v1/partner_referral_links
```

## Request Body

| Parameter       | Type    | Required | Description                         |
| --------------- | ------- | -------- | ----------------------------------- |
| `key`           | string  | Yes      | Unique key for the referral link    |
| `domain_id`     | string  | No       | Domain ID (from domains endpoint)   |
| `is_additional` | boolean | No\*     | Required when domain\_id is present |
| `partner`       | object  | Yes      | Partner to assign the link to       |
| `partner.id`    | string  | Yes\*    | Partner ID (or use key/email)       |
| `partner.key`   | string  | Yes\*    | Partner key (or use id/email)       |
| `partner.email` | string  | Yes\*    | Partner email (or use id/key)       |

## Request

```bash cURL theme={null}
curl --location 'https://api.partnero.com/v1/partner_referral_links' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "partner": {
      "id": "partner_123"
    },
    "key": "ref_456"
  }'
```

## Response

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "data": {
      "id": "ref_456",
      "key": "ref_456",
      "url": "https://partnero.com?aff=ref_456",
      "default": false,
      "is_additional": false,
      "direct_tracking": false,
      "direct_tracking_redirect": false,
      "direct_tracking_redirect_url": null
    },
    "status": 1
  }
  ```
</ResponseExample>

## Get Available Domains

Get the list of domains you can use for referral links:

```bash theme={null}
GET https://api.partnero.com/v1/partner_referral_links:domains
```

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": [
      {
        "id": null,
        "domain": "partnero.com",
        "url": "https://partnero.com?aff=",
        "is_additional": false
      }
    ],
    "status": 1
  }
  ```
</ResponseExample>
