> ## 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 partner

> Create a new affiliate partner in your program programmatically

## Endpoint

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

<Note>
  Partners are automatically created when someone signs up through the partner portal. Use this endpoint to create partners programmatically.
</Note>

## Request body

| Parameter                 | Type   | Required | Description                                                                                                          |
| ------------------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `email`                   | string | Yes      | Must be a unique email address                                                                                       |
| `name`                    | string | No       | Partner's first name                                                                                                 |
| `surname`                 | string | No       | Partner's last name                                                                                                  |
| `password`                | string | No       | Password for portal login. Auto-generated if not provided. Must have min 8 chars, 1 lowercase, 1 uppercase, 1 number |
| `id`                      | string | No       | Custom unique ID (auto-generated if not provided)                                                                    |
| `key`                     | string | No       | Referral key for links (auto-generated if not provided)                                                              |
| `tags`                    | array  | No       | Tags to associate with the partner                                                                                   |
| `referring_partner`       | object | No       | Assign a referring partner (multi-tier programs)                                                                     |
| `referring_partner.id`    | string | No       | Referring partner's ID                                                                                               |
| `referring_partner.key`   | string | No       | Referring partner's key                                                                                              |
| `referring_partner.email` | string | No       | Referring partner's email                                                                                            |

## Request

```bash cURL theme={null}
curl --location 'https://api.partnero.com/v1/partners' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "email": "john.doe@partnero.com",
    "name": "John",
    "surname": "Doe",
    "tags": ["new", "premium"]
  }'
```

## Response

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "data": {
      "email": "john.doe@partnero.com",
      "created_at": "2025-04-30T16:44:13.000000Z",
      "updated_at": "2025-04-30T16:44:13.000000Z",
      "name": "John",
      "id": "partner_123",
      "surname": "Doe",
      "tos": false,
      "approved": true,
      "status": "active",
      "custom_fields": [],
      "referrals_count": 0,
      "tags": [
        {
          "value": "premium"
        },
        {
          "value": "new"
        }
      ],
      "referral_link": "https://yourcompany.com?aff=ref_123",
      "referral_links": [
        "https://yourcompany.com?aff=ref_123"
      ]
    },
    "status": 1
  }
  ```
</ResponseExample>

## Error responses

| Status | Error                       | Solution                                 |
| ------ | --------------------------- | ---------------------------------------- |
| 422    | Email already exists        | Use a unique email address               |
| 422    | ID already exists           | Use a unique partner ID                  |
| 422    | Key already exists          | Use a unique referral key                |
| 400    | Referring partner not found | Check the referring partner ID/key/email |

## Invite a partner

Send an invitation email to a potential partner. The partner receives an email with a link to sign up through the portal.

```
POST https://api.partnero.com/v1/partners:invite
```

<Note>
  This endpoint is available for affiliate programs only.
</Note>

| Parameter | Type   | Required | Description                  |
| --------- | ------ | -------- | ---------------------------- |
| `email`   | string | Yes      | Email address of the partner |
| `name`    | string | Yes      | Partner's first name         |
| `surname` | string | No       | Partner's last name          |

```bash cURL theme={null}
curl --location 'https://api.partnero.com/v1/partners:invite' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "jane.smith@partnero.com",
    "name": "Jane",
    "surname": "Smith"
  }'
```
