Skip to content

V3 API + Sandbox #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The official Python client for communicating with the <a href="https://upstox.co
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.

- API version: v2
- Package version: 2.10.0
- Package version: 2.11.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project.
Expand Down Expand Up @@ -70,6 +70,7 @@ Class | Method | HTTP request | Description
*HistoryApi* | [**get_historical_candle_data1**](docs/HistoryApi.md#get_historical_candle_data1) | **GET** /v2/historical-candle/{instrumentKey}/{interval}/{to_date}/{from_date} | Historical candle data
*HistoryApi* | [**get_intra_day_candle_data**](docs/HistoryApi.md#get_intra_day_candle_data) | **GET** /v2/historical-candle/intraday/{instrumentKey}/{interval} | Intra day candle data
*LoginApi* | [**authorize**](docs/LoginApi.md#authorize) | **GET** /v2/login/authorization/dialog | Authorize API
*LoginApi* | [**init_token_request_for_indie_user**](docs/LoginApi.md#init_token_request_for_indie_user) | **POST** /v3/login/auth/token/request/{client_id} | Init token API
*LoginApi* | [**logout**](docs/LoginApi.md#logout) | **DELETE** /v2/logout | Logout
*LoginApi* | [**token**](docs/LoginApi.md#token) | **POST** /v2/login/authorization/token | Get token API
*MarketHolidaysAndTimingsApi* | [**get_exchange_timings**](docs/MarketHolidaysAndTimingsApi.md#get_exchange_timings) | **GET** /v2/market/timings/{date} | Get Exchange Timings on particular date
Expand Down Expand Up @@ -105,6 +106,9 @@ Class | Method | HTTP request | Description
*WebsocketApi* | [**get_market_data_feed_authorize**](docs/WebsocketApi.md#get_market_data_feed_authorize) | **GET** /v2/feed/market-data-feed/authorize | Market Data Feed Authorize
*WebsocketApi* | [**get_portfolio_stream_feed**](docs/WebsocketApi.md#get_portfolio_stream_feed) | **GET** /v2/feed/portfolio-stream-feed | Portfolio Stream Feed
*WebsocketApi* | [**get_portfolio_stream_feed_authorize**](docs/WebsocketApi.md#get_portfolio_stream_feed_authorize) | **GET** /v2/feed/portfolio-stream-feed/authorize | Portfolio Stream Feed Authorize
*OrderApiV3* | [**cancel_order**](docs/OrderApiV3.md#cancel_order) | **DELETE** /v3/order/cancel |
*OrderApiV3* | [**modify_order**](docs/OrderApiV3.md#modify_order) | **PUT** /v3/order/modify |
*OrderApiV3* | [**place_order**](docs/OrderApiV3.md#place_order) | **POST** /v3/order/place |

## Documentation for Feeder Functions

Expand Down Expand Up @@ -762,6 +766,7 @@ if __name__ == "__main__":
- [CancelOrExitOrderErrorData](docs/CancelOrExitOrderErrorData.md)
- [CancelOrderData](docs/CancelOrderData.md)
- [CancelOrderResponse](docs/CancelOrderResponse.md)
- [CancelOrderV3Response](docs/CancelOrderV3Response.md)
- [ConvertPositionData](docs/ConvertPositionData.md)
- [ConvertPositionRequest](docs/ConvertPositionRequest.md)
- [ConvertPositionResponse](docs/ConvertPositionResponse.md)
Expand Down Expand Up @@ -794,6 +799,9 @@ if __name__ == "__main__":
- [HistoricalCandleData](docs/HistoricalCandleData.md)
- [HoldingsData](docs/HoldingsData.md)
- [HolidayData](docs/HolidayData.md)
- [IndieUserInitTokenData](docs/IndieUserInitTokenData.md)
- [IndieUserInitTokenResponse](docs/IndieUserInitTokenResponse.md)
- [IndieUserTokenRequest](docs/IndieUserTokenRequest.md)
- [Instrument](docs/Instrument.md)
- [InstrumentData](docs/InstrumentData.md)
- [IntraDayCandleData](docs/IntraDayCandleData.md)
Expand All @@ -809,11 +817,13 @@ if __name__ == "__main__":
- [ModifyOrderData](docs/ModifyOrderData.md)
- [ModifyOrderRequest](docs/ModifyOrderRequest.md)
- [ModifyOrderResponse](docs/ModifyOrderResponse.md)
- [ModifyOrderV3Response](docs/ModifyOrderV3Response.md)
- [MultiOrderData](docs/MultiOrderData.md)
- [MultiOrderError](docs/MultiOrderError.md)
- [MultiOrderRequest](docs/MultiOrderRequest.md)
- [MultiOrderResponse](docs/MultiOrderResponse.md)
- [MultiOrderSummary](docs/MultiOrderSummary.md)
- [MultiOrderV3Data](docs/MultiOrderV3Data.md)
- [OAuthClientException](docs/OAuthClientException.md)
- [OAuthClientExceptionCause](docs/OAuthClientExceptionCause.md)
- [OAuthClientExceptionCauseStackTrace](docs/OAuthClientExceptionCauseStackTrace.md)
Expand All @@ -822,10 +832,13 @@ if __name__ == "__main__":
- [OptionStrikeData](docs/OptionStrikeData.md)
- [OrderBookData](docs/OrderBookData.md)
- [OrderData](docs/OrderData.md)
- [OrderMetadata](docs/OrderMetadata.md)
- [OtherTaxes](docs/OtherTaxes.md)
- [PlaceOrderData](docs/PlaceOrderData.md)
- [PlaceOrderRequest](docs/PlaceOrderRequest.md)
- [PlaceOrderResponse](docs/PlaceOrderResponse.md)
- [PlaceOrderV3Request](docs/PlaceOrderV3Request.md)
- [PlaceOrderV3Response](docs/PlaceOrderV3Response.md)
- [PositionData](docs/PositionData.md)
- [PostMarginResponse](docs/PostMarginResponse.md)
- [Problem](docs/Problem.md)
Expand Down
11 changes: 11 additions & 0 deletions docs/CancelOrderV3Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CancelOrderV3Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**status** | **str** | | [optional]
**data** | [**CancelOrderData**](CancelOrderData.md) | | [optional]
**metadata** | [**OrderMetadata**](OrderMetadata.md) | | [optional]

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

52 changes: 52 additions & 0 deletions docs/ChargeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,55 @@ Name | Type | Description | Notes

[[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)

# **post_margin**
> PostMarginResponse post_margin(body)

Calculate Margin

Compute Margin

### Example
```python
from __future__ import print_function
import time
import upstox_client
from upstox_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: OAUTH2
configuration = upstox_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = upstox_client.ChargeApi(upstox_client.ApiClient(configuration))
body = upstox_client.MarginRequest() # MarginRequest |

try:
# Calculate Margin
api_response = api_instance.post_margin(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ChargeApi->post_margin: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**MarginRequest**](MarginRequest.md)| |

### Return type

[**PostMarginResponse**](PostMarginResponse.md)

### Authorization

[OAUTH2](../README.md#OAUTH2)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json, */*

[[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)

10 changes: 10 additions & 0 deletions docs/IndieUserInitTokenData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# IndieUserInitTokenData

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**authorization_expiry** | **str** | authorize token expiry | [optional]
**notifier_url** | **str** | notifier webhook url | [optional]

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

10 changes: 10 additions & 0 deletions docs/IndieUserInitTokenResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# IndieUserInitTokenResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**status** | **str** | | [optional]
**data** | [**IndieUserInitTokenData**](IndieUserInitTokenData.md) | | [optional]

[[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 changes: 9 additions & 0 deletions docs/IndieUserTokenRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# IndieUserTokenRequest

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client_secret** | **str** | OAuth client secret that is a private secret known only to app and authorization server | [optional]

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

50 changes: 50 additions & 0 deletions docs/LoginApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,56 @@ No authorization required

[[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)

# **init_token_request_for_indie_user**
> IndieUserInitTokenResponse init_token_request_for_indie_user(body, client_id)

Init token API

This API provides the initialize the generate token and it's expiry for an indie user

### Example
```python
from __future__ import print_function
import time
import upstox_client
from upstox_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = upstox_client.LoginApi()
body = upstox_client.IndieUserTokenRequest() # IndieUserTokenRequest |
client_id = 'client_id_example' # str |

try:
# Init token API
api_response = api_instance.init_token_request_for_indie_user(body, client_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling LoginApi->init_token_request_for_indie_user: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**IndieUserTokenRequest**](IndieUserTokenRequest.md)| |
**client_id** | **str**| |

### Return type

[**IndieUserInitTokenResponse**](IndieUserInitTokenResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json, */*

[[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)

# **logout**
> LogoutResponse logout(api_version)

Expand Down
11 changes: 11 additions & 0 deletions docs/ModifyOrderV3Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ModifyOrderV3Response

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**status** | **str** | | [optional]
**data** | [**ModifyOrderData**](ModifyOrderData.md) | | [optional]
**metadata** | [**OrderMetadata**](OrderMetadata.md) | | [optional]

[[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 changes: 9 additions & 0 deletions docs/MultiOrderV3Data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MultiOrderV3Data

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**order_ids** | **list[str]** | | [optional]

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

Loading