# Order Connect [Offsite Orders]

## GET /api-gw/oauth/order-connect

Order Connect [Offsite Orders]

Authorize to place orders and get oAuth Code to the redirect url at once.

**Note:** This API cannot be tested from this API document since it gets redirected.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| client_id | query | string | Yes | Your app's alphanumeric API key from the [Apps Section](https://developer.tradejini.com/developer-portal) app registration page. If the value does not match the registered app, authorization will be denied. |
| redirect_uri | query | string | Yes | The callback URL registered in your app on the [Apps Section](https://developer.tradejini.com/developer-portal). Must match exactly — if it does not, authorization will be denied. |
| response_type | query | string ("code") | Yes | As per oAuth specification this value should be __"code"__ |
| scope | query | string ("general") | Yes | This field value should be __"general"__. |
| state | query | string | Yes | A literal string that will be return in the final redirection callback. |
| params | query | string | Yes | This field value should be the params required to place orders in json array format and get oAuth Code.  **Note:** Each array value should match any of examples provided. Else your authorization will fail.  Example: ```json [{"exch":"NSE","symbol":"ACC","series":"EQ","inst":"EQT","qty":10,"side":"buy","type":"limit","product":"intraday","limitPrice":2700.55,"validity":"day"},{"exch":"NFO","symbol":"NIFTY","expiry":"2022-11-24","inst":"FUTIDX","qty":2000,"side":"sell","type":"market","product":"intraday","limitPrice":0,"validity":"ioc","discQty":500},{"exch":"NFO","symbol":"BANKNIFTY","expiry":"2022-11-24","optType":"PE","inst":"OPTIDX","strike":"34000","qty":1500,"side":"buy","type":"market","product":"delivery","limitPrice":0,"validity":"day","mktProt":5}] ```  For equity symbol instrument must be `EQT` |

### Responses

#### 302 — Redirect to login page or redirect url with code.

#### 400 — Bad order params

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string ("Internal Error occurred. Kindly try again." | "Input validation failed. Kindly check your input contains required fields for the request") | No | Error message describing which field failed validation or why the request was rejected. |

#### 401 — Unauthorized — wrong `client_id`, password, or 2FA value. Verify credentials and ensure `twoFaTyp` matches the 2FA value type.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string ("Unauthorized") | No | Error message. |