Our application can successfully authenticate and access all read APIs (profile, LTP, quotes, funds, positions, instruments), but order placement consistently returns 401 Unauthorized with error code UDAPI100050.
Endpoint Tested #1 (v3 API):
POST https://api-hft.upstox.com/v3/order/place
Endpoint Tested #2 (v2 API):
POST https://api-hft.upstox.com/v2/order/place
Request Headers:
Authorization: Bearer {access_token}
Accept: application/json
Content-Type: application/json
Request Payload:
{
“instrument_token”: “NSE_EQ|INE002A01018”,
“quantity”: 1,
“transaction_type”: “BUY”,
“order_type”: “LIMIT”,
“product”: “I”,
“validity”: “DAY”,
“price”: 1.0,
“trigger_price”: 0.0,
“disclosed_quantity”: 0,
“is_amo”: false
}
================================================================================
EXACT ERROR RESPONSE
HTTP Status Code: 401 Unauthorized
Response Body (v3 API):
{
“status”: “error”,
“errors”: [
{
“errorCode”: “UDAPI100050”,
“message”: “Invalid token used to access API”,
“propertyPath”: null,
“invalidValue”: null,
“error_code”: “UDAPI100050”,
“property_path”: null,
“invalid_value”: null
}
]
}
Response Body (v2 API):
{
“status”: “error”,
“errors”: [
{
“errorCode”: “UDAPI100050”,
“message”: “Invalid token used to access API”,
“propertyPath”: null,
“invalidValue”: null,
“error_code”: “UDAPI100050”,
“property_path”: null,
“invalid_value”: null
}
]
}
The following APIs work perfectly with the SAME access token:
✓ Authentication APIs
- GET /v2/user/profile → 200 OK
- GET /v2/user/get-funds-and-margin → 200 OK
✓ Market Data APIs
- GET /v3/market-quote/ltp → 200 OK
- GET /v2/market-quote/quotes → 200 OK
✓ Portfolio APIs
- GET /v2/portfolio/short-term-positions → 200 OK
- GET /v2/portfolio/long-term-holdings → 200 OK
✓ Order History APIs
- GET /v2/order/retrieve-all → 200 OK
✓ Instrument APIs
- GET /v2/market-quote/instrument → 200 OK
✗ Order Placement APIs
- POST /v3/order/place (v3) → 401 Unauthorized
- POST /v2/order/place (v2) → 401 Unauthorized
Both endpoints return identical error: UDAPI100050
Tried with sdk also, same error.
================================================================================
QUESTIONS FOR SUPPORT
-
Does the access token need specific scope/permissions for order placement?
- If yes, what scope parameter should be included during OAuth authorization?
-
Is there a separate API key permission setting required?
- Are there different permission levels for read vs write operations?
-
Is there a difference between v3 API and v2 API permissions?
- Do they require different authorization?
-
Account Type Verification:
- Does order placement require a specific account type?
-
API Key Configuration:
- Should we regenerate the API key with specific permissions?
- Is there an app approval process for trading permissions?
