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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.polynomial.fi/developer-documentation/api/trade-referral.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
