> For the complete documentation index, see [llms.txt](https://docs.shoffi.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shoffi.app/the-shoffi-api/add-referral.md).

# Add Referral

## Add a manual referral for an affiliate

<mark style="color:green;">`POST`</mark> `https://platform.shoffi.app/API/affiliate/addReferral`

Use this endpoint to add a manual referral directly to an affiliate.

#### Request Body

| Name                                             | Type    | Description                                                                                                        |
| ------------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------ |
| apiKey<mark style="color:red;">\*</mark>         | String  | Your Shoffi app API Key                                                                                            |
| appId<mark style="color:red;">\*</mark>          | Integer | Your app ID                                                                                                        |
| email<mark style="color:red;">\*</mark>          | String  | The affiliate email address                                                                                        |
| shopName<mark style="color:red;">\*</mark>       | String  | The full `.myshopify.com` store URL of the referred shop                                                           |
| calManualBegin<mark style="color:red;">\*</mark> | Boolean | Controls manual referral commission calculation. `true` uses the app installation date. `false` starts from today. |

```bash
curl -X POST \
  https://platform.shoffi.app/API/affiliate/addReferral \
  -H 'Content-Type: application/json' \
  -d '{
    "apiKey": "YourKey",
    "appId": 00000000,
    "email": "affiliate@example.com",
    "shopName": "https://store.myshopify.com",
    "calManualBegin": true
}'
```

## Parameters breakdown

* `email:`\
  The affiliate email address.
* `shopName:`\
  The full `.myshopify.com` store URL of the referred shop.
* `calManualBegin:`\
  Controls how Shoffi calculates the manual referral commission.
  * `true` calculates commission from the app installation date.
  * `false` calculates commission from today.

For more about manual referral calculation modes, see [Manual referrals](/for-affiliates/manual-referrals.md).
