Skip to content

Commit 4837309

Browse files
authored
init commit for gtt addition (#98)
1 parent 42fa80c commit 4837309

40 files changed

+3040
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The official Python client for communicating with the <a href="https://upstox.co
99
Upstox API is a set of rest APIs that provide data required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio, stream live market data (using Websocket), and more, with the easy to understand API collection.
1010

1111
- API version: v2
12-
- Package version: 2.12.0
12+
- Package version: 2.13.0
1313
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
1414

1515
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project.

docs/GetGttOrderResponse.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# GetGttOrderResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**status** | **str** | | [optional]
7+
**data** | [**list[GttOrderDetails]**](GttOrderDetails.md) | Response data for order details | [optional]
8+
**metadata** | [**OrderMetadata**](OrderMetadata.md) | | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+

docs/GttCancelOrderRequest.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# GttCancelOrderRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**gtt_order_id** | **str** | Unique identifier of the GTT order to be cancelled |
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+

docs/GttModifyOrderRequest.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# GttModifyOrderRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**type** | **str** | Type of GTT order. It can be one of the following: SINGLE refers to a single-leg GTT order MULTIPLE refers to a multi-leg GTT order |
7+
**quantity** | **int** | Quantity with which the order is to be placed |
8+
**rules** | [**list[GttRule]**](GttRule.md) | List of rules defining the conditions for each leg in the GTT order |
9+
**gtt_order_id** | **str** | Unique identifier of the GTT order to be modified |
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+

docs/GttOrderData.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# GttOrderData
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**gtt_order_ids** | **list[str]** | Order ID for the placed GTT order | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+

docs/GttOrderDetails.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# GttOrderDetails
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**type** | **str** | | [optional]
7+
**exchange** | **str** | | [optional]
8+
**quantity** | **int** | | [optional]
9+
**product** | **str** | | [optional]
10+
**rules** | [**list[Rule]**](Rule.md) | | [optional]
11+
**trading_symbol** | **str** | | [optional]
12+
**instrument_token** | **str** | | [optional]
13+
**gtt_order_id** | **str** | | [optional]
14+
**expires_at** | **int** | | [optional]
15+
**created_at** | **int** | | [optional]
16+
17+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
18+

docs/GttPlaceOrderRequest.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# GttPlaceOrderRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**type** | **str** | Type of GTT order. It can be one of the following: SINGLE refers to a single-leg GTT order MULTIPLE refers to a multi-leg GTT order |
7+
**quantity** | **int** | Quantity with which the order is to be placed |
8+
**product** | **str** | Signifies if the order was either Intraday, Delivery, CO or OCO |
9+
**rules** | [**list[GttRule]**](GttRule.md) | List of rules defining the conditions for each leg in the GTT order |
10+
**instrument_token** | **str** | Key of the instrument |
11+
**transaction_type** | **str** | Indicates whether its a buy or sell order |
12+
13+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14+

docs/GttRule.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# GttRule
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**strategy** | **str** | Defines the strategy for the GTT order leg: ENTRY - First leg order STOPLOSS - Stop-loss order TARGET - Target order |
7+
**trigger_type** | **str** | Trigger type for each leg of the order |
8+
**trigger_price** | **float** | Trigger price for the GTT order leg |
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+

docs/GttTriggerOrderResponse.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# GttTriggerOrderResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**status** | **str** | | [optional]
7+
**data** | [**GttOrderData**](GttOrderData.md) | | [optional]
8+
**metadata** | [**OrderMetadata**](OrderMetadata.md) | | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+

docs/OrderApiV3.md

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,58 @@ Method | HTTP request | Description
88
[**modify_order**](OrderApiV3.md#modify_order) | **PUT** /v3/order/modify |
99
[**place_order**](OrderApiV3.md#place_order) | **POST** /v3/order/place |
1010

11+
# **cancel_gtt_order**
12+
> GttTriggerOrderResponse cancel_gtt_order(body)
13+
14+
Cancel GTT order
15+
16+
This API allows you to cancel GTT orders.
17+
18+
### Example
19+
```python
20+
from __future__ import print_function
21+
import time
22+
import upstox_client
23+
from upstox_client.rest import ApiException
24+
from pprint import pprint
25+
26+
# Configure OAuth2 access token for authorization: OAUTH2
27+
configuration = upstox_client.Configuration()
28+
configuration.access_token = 'YOUR_ACCESS_TOKEN'
29+
30+
# create an instance of the API class
31+
api_instance = upstox_client.OrderApiV3(upstox_client.ApiClient(configuration))
32+
body = upstox_client.GttCancelOrderRequest() # GttCancelOrderRequest |
33+
34+
try:
35+
# Cancel GTT order
36+
api_response = api_instance.cancel_gtt_order(body)
37+
pprint(api_response)
38+
except ApiException as e:
39+
print("Exception when calling OrderApiV3->cancel_gtt_order: %s\n" % e)
40+
```
41+
42+
### Parameters
43+
44+
Name | Type | Description | Notes
45+
------------- | ------------- | ------------- | -------------
46+
**body** | [**GttCancelOrderRequest**](GttCancelOrderRequest.md)| |
47+
48+
### Return type
49+
50+
[**GttTriggerOrderResponse**](GttTriggerOrderResponse.md)
51+
52+
### Authorization
53+
54+
[OAUTH2](../README.md#OAUTH2)
55+
56+
### HTTP request headers
57+
58+
- **Content-Type**: application/json
59+
- **Accept**: */*, application/json
60+
61+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
62+
1163
# **cancel_order**
1264
> CancelOrderV3Response cancel_order(order_id)
1365
@@ -53,6 +105,110 @@ No authorization required
53105

54106
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
55107

108+
# **get_gtt_order_details**
109+
> GetGttOrderResponse get_gtt_order_details(gtt_order_id=gtt_order_id)
110+
111+
Get GTT order details
112+
113+
GTT_ORDER_DESCRIPTION
114+
115+
### Example
116+
```python
117+
from __future__ import print_function
118+
import time
119+
import upstox_client
120+
from upstox_client.rest import ApiException
121+
from pprint import pprint
122+
123+
# Configure OAuth2 access token for authorization: OAUTH2
124+
configuration = upstox_client.Configuration()
125+
configuration.access_token = 'YOUR_ACCESS_TOKEN'
126+
127+
# create an instance of the API class
128+
api_instance = upstox_client.OrderApiV3(upstox_client.ApiClient(configuration))
129+
gtt_order_id = 'gtt_order_id_example' # str | Unique identifier of the GTT order for which the order history is required (optional)
130+
131+
try:
132+
# Get GTT order details
133+
api_response = api_instance.get_gtt_order_details(gtt_order_id=gtt_order_id)
134+
pprint(api_response)
135+
except ApiException as e:
136+
print("Exception when calling OrderApiV3->get_gtt_order_details: %s\n" % e)
137+
```
138+
139+
### Parameters
140+
141+
Name | Type | Description | Notes
142+
------------- | ------------- | ------------- | -------------
143+
**gtt_order_id** | **str**| Unique identifier of the GTT order for which the order history is required | [optional]
144+
145+
### Return type
146+
147+
[**GetGttOrderResponse**](GetGttOrderResponse.md)
148+
149+
### Authorization
150+
151+
[OAUTH2](../README.md#OAUTH2)
152+
153+
### HTTP request headers
154+
155+
- **Content-Type**: Not defined
156+
- **Accept**: */*, application/json
157+
158+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
159+
160+
# **modify_gtt_order**
161+
> GttTriggerOrderResponse modify_gtt_order(body)
162+
163+
Modify GTT order
164+
165+
This API allows you to modify GTT orders.
166+
167+
### Example
168+
```python
169+
from __future__ import print_function
170+
import time
171+
import upstox_client
172+
from upstox_client.rest import ApiException
173+
from pprint import pprint
174+
175+
# Configure OAuth2 access token for authorization: OAUTH2
176+
configuration = upstox_client.Configuration()
177+
configuration.access_token = 'YOUR_ACCESS_TOKEN'
178+
179+
# create an instance of the API class
180+
api_instance = upstox_client.OrderApiV3(upstox_client.ApiClient(configuration))
181+
body = upstox_client.GttModifyOrderRequest() # GttModifyOrderRequest |
182+
183+
try:
184+
# Modify GTT order
185+
api_response = api_instance.modify_gtt_order(body)
186+
pprint(api_response)
187+
except ApiException as e:
188+
print("Exception when calling OrderApiV3->modify_gtt_order: %s\n" % e)
189+
```
190+
191+
### Parameters
192+
193+
Name | Type | Description | Notes
194+
------------- | ------------- | ------------- | -------------
195+
**body** | [**GttModifyOrderRequest**](GttModifyOrderRequest.md)| |
196+
197+
### Return type
198+
199+
[**GttTriggerOrderResponse**](GttTriggerOrderResponse.md)
200+
201+
### Authorization
202+
203+
[OAUTH2](../README.md#OAUTH2)
204+
205+
### HTTP request headers
206+
207+
- **Content-Type**: application/json
208+
- **Accept**: */*, application/json
209+
210+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
211+
56212
# **modify_order**
57213
> ModifyOrderV3Response modify_order(body)
58214
@@ -98,6 +254,58 @@ No authorization required
98254

99255
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
100256

257+
# **place_gtt_order**
258+
> GttTriggerOrderResponse place_gtt_order(body)
259+
260+
Place GTT order
261+
262+
This API allows you to place GTT orders.
263+
264+
### Example
265+
```python
266+
from __future__ import print_function
267+
import time
268+
import upstox_client
269+
from upstox_client.rest import ApiException
270+
from pprint import pprint
271+
272+
# Configure OAuth2 access token for authorization: OAUTH2
273+
configuration = upstox_client.Configuration()
274+
configuration.access_token = 'YOUR_ACCESS_TOKEN'
275+
276+
# create an instance of the API class
277+
api_instance = upstox_client.OrderApiV3(upstox_client.ApiClient(configuration))
278+
body = upstox_client.GttPlaceOrderRequest() # GttPlaceOrderRequest |
279+
280+
try:
281+
# Place GTT order
282+
api_response = api_instance.place_gtt_order(body)
283+
pprint(api_response)
284+
except ApiException as e:
285+
print("Exception when calling OrderApiV3->place_gtt_order: %s\n" % e)
286+
```
287+
288+
### Parameters
289+
290+
Name | Type | Description | Notes
291+
------------- | ------------- | ------------- | -------------
292+
**body** | [**GttPlaceOrderRequest**](GttPlaceOrderRequest.md)| |
293+
294+
### Return type
295+
296+
[**GttTriggerOrderResponse**](GttTriggerOrderResponse.md)
297+
298+
### Authorization
299+
300+
[OAUTH2](../README.md#OAUTH2)
301+
302+
### HTTP request headers
303+
304+
- **Content-Type**: application/json
305+
- **Accept**: */*, application/json
306+
307+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
308+
101309
# **place_order**
102310
> PlaceOrderV3Response place_order(body)
103311

0 commit comments

Comments
 (0)