# FlatTrade

FlatTrade is an Indian discount broker recognized for its flat-fee brokerage model, which ensures cost-effective trading solutions for investors. The platform supports trading across multiple asset classes, including stocks, derivatives, and commodities, via its intuitive mobile and web applications. With features like real-time data feeds, customizable charting tools, and fast order execution, FlatTrade is designed to cater to traders seeking affordability without compromising on essential functionality.

## Getting API Credentials

To integrate Flattrade with OpenAlgo, follow these steps to obtain your API key and secret:

1\. Log in to Flattrade Wall

• Login to Wall [https://wall.flattrade.in](https://wall.flattrade.in/)

Enter your Flattrade login credentials.

2\. Navigate to Pi in top menu bar , select api(v2) and click on “CREATE NEW API KEY”.

<figure><img src="https://17901342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBwEhITzgv0O0fEGIIRN%2Fuploads%2FmwWO1L9smR5zM3UfULet%2Fflat1.PNG?alt=media&#x26;token=8663f9b4-4c3f-4405-a10b-2d8f72a6bcad" alt=""><figcaption></figcaption></figure>

3.Click on Create the New API Key, select Order Volume :

<figure><img src="https://17901342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBwEhITzgv0O0fEGIIRN%2Fuploads%2FvVnact5OEkbQIUHKr9Mp%2Fflat4.PNG?alt=media&#x26;token=d53ac64f-8704-448b-91b2-bf2560d3087b" alt=""><figcaption></figcaption></figure>

4.Enter your IP Configuration (Primary IP is required, Secondary is optional) → Click Next

<figure><img src="https://17901342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBwEhITzgv0O0fEGIIRN%2Fuploads%2F3w3Tv2RJeFHgswFTm43S%2Fflat2.PNG?alt=media&#x26;token=6f018dcd-4460-44cf-8e4e-29816e825931" alt=""><figcaption></figcaption></figure>

5.Fill out the URL Configuration

<figure><img src="https://17901342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBwEhITzgv0O0fEGIIRN%2Fuploads%2FeZhDDHEOpFhF8him8HdG%2Fflat3.PNG?alt=media&#x26;token=8bbd55f9-7b67-47bd-a327-1e91ac992470" alt=""><figcaption></figcaption></figure>

6.Review the Configuration Summary, tick the box to accept Terms & Conditions, and Submit

7.Your request will show as Pending — once approved, your API key is ready!

8.Your API key is now generated

<figure><img src="https://17901342-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBwEhITzgv0O0fEGIIRN%2Fuploads%2F8STzioEMF9KarCZdeHnp%2Fflat5.PNG?alt=media&#x26;token=12d3114d-81d0-4a1f-b351-f433d4c11182" alt=""><figcaption></figcaption></figure>

9.Click the eye icon to reveal your Secret Key — Copy both API and Secret Key and start building!

10\. Configure OpenAlgo:

• In your OpenAlgo .env file, set the following variables:

```bash
BROKER_API_KEY = 'client_id:::api_key'
BROKER_API_SECRET = 'api_secret'
REDIRECT_URL = 'http://127.0.0.1:5000/flattrade/callback'
```
