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

# Trade Referral

Developers can build custom integrations to onboard users using a referral code and earn a share of their trading fees. Integration users will be required to sign a predefined message to redeem your referral code.

**Related links:**

* [Generate a referral code](https://polynomial.fi/en/mainnet/portfolio/referrals)
* [Referral fee structure](https://docs.polynomial.fi/trade/trade/referral-program)

### Redeem a referral code

Use this endpoint to redeem a referral code.&#x20;

`POST`  `https://trading-rewards-mainnet.polynomial.finance/referrals/accept`

#### Headers&#x20;

| Name         | Value                                                                                  |
| ------------ | -------------------------------------------------------------------------------------- |
| Content-Type | application/json                                                                       |
| Accept       | application/json                                                                       |
| x-api-key    | [Introduction](/developer-documentation/api/introduction.md#backend-api-key)(optional) |

#### Request body

| Name          | Type   | Description                                                               |
| ------------- | ------ | ------------------------------------------------------------------------- |
| wallet        | string | Integration Users wallet Address                                          |
| referralCode  | string | Developer's accounts referral code                                        |
| signedMessage | string | User Signed Message, content  - `Accepting referral for Polynomial Perps` |

#### Success Response - `HTTP 201`
