FAQs
Error while importing holdings
I am trying to create a transaction id for user consent for importing holding but the API is giving error as "Intent not enabled". For is the API used and parameters sent
API : "https://gatewayapi.smallcase.com/gateway/gatewayname/transaction"
Type : POST
Parameters : {"intent": "HOLDINGS_IMPORT"}
Headers :
x-gateway-authtoken : jwt token with smallcaseAuthId
x-gateway-secret : Provided by smallcase
Posted by Tushar Nisal over 2 years ago
Not getting proper response
as per docs in tiggertransaction promise if I am using expired transactionId then I should get transactionId expired error .... but always I am getting Error occurred during transaction .
await SmallcaseGateway.triggerTransaction("TRX_792147332a7444aea91bd89885c33f9c")
.then((res) => console.log("res", res))
.catch((err) => console.log("err", err));
Even when I am trying to login and cancel in between then also I just get Error occurred during transaction... not getting error code or any other msg in res...
Posted by Arpit Chandak over 2 years ago
Do I need to do any broker login-related handling on our end?
Posted by smallcase Gateway almost 3 years ago
Single Stock Update Webhook - Average Price
In the response of single stock update webhook, We have following response:
{
"batchId": "XXXXXXXXXXXXXX",
"buyAmount": 0,
"sellAmount": 24360.119999999995,
"quantity": 1,
"filled": 1,
"status": "COMPLETED",
"variety": "regular",
"completedDate": "2022-01-07T14:17:23.276Z",
"orders": [
{
"status": "COMPLETE",
"quantity": 10,
"tradingsymbol": "RELIANCE",
"transactionType": "SELL",
"averagePrice": 2436.0119999999997,
"exchange": "NSE",
"orderType": "MARKET",
"product": "CNC",
"filledQuantity": 10,
"exchangeOrderId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
],
"unplaced": [],
"transactionId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"broker": "kite-leprechaun",
"smallcaseAuthId": "XXXXXXXXXXXXXXXXXXXXX",
"timestamp": "2022-01-07T14:17:23.286Z",
"checksum": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
Here, when the transaction type is SELL and we get the average price. What does this average Price represents? Is it the Sell Price per Share for this SELL transaction?
Similarly, when the transaction type is BUY and we get the average price. Is it the price at which those shares were bought or the weighted average price of all the shares for that ticker?
For ex. We buy 2 share of ticker X at price A and 1 share of same ticker X at price B.
The average price that we'll get in the BUY order of X at price B, is it the weighted average price for the current holdings (2 (at price A) +1 (at price B) = 3 shares) or the price at which that share was bought (B in this case) ?
Posted by Meet Patel over 2 years ago
Java sdk
How I can connect my Java backend to call smallcase api/sdk endpoints to buy/sell stocks.
Posted by Parul Garg over 2 years ago
InitGateway Issue in Flutter SDK
Hello Team,
I am facing issue while initialising Gateway using ScgatewayFlutterPlugin.
I have set Environment config params: (GatewayEnvironment.DEVELOPMENT, {my_gateway}, true, [])
that returns with Future {"success": true}
Code for initialising Gateway
```
ScgatewayFlutterPlugin.setConfigEnvironment(
GatewayEnvironment.DEVELOPMENT, {my_gateway}, true, []).then((value) {
String authToken =
{my_auth_token};
ScgatewayFlutterPlugin.initGateway(authToken).then((value) {
print("Init gateway complete: $value");
});
});
```
authToken is generated with secret provided, expiresIn time "1d" and {guest: true} using jwt as suggested in documentation.
I am getting output as:
D/Android_Native_Scgateway( 6338): onFailure: internal_error
I/flutter ( 6338): Init response: {"errorCode":2000,"errorMessage":"internal_error"}
I/flutter ( 6338): Init gateway complete: {"errorCode":2000,"errorMessage":"internal_error"}
Please help me with this asap
Thanks
Posted by Rishabh Sharma over 2 years ago
Getting error while triggering a transaction
I am getting a `Network Error` while triggering a transaction. The flow is as follows.
1. User login with Smallcase SDK.
2. Got the Smallcase Auth token.
3. User changes the auth token in the cookies and refreshes the page.
4. User clicks on the login button as we already have Smallcase auth token we have initialized the SDK (with the invalid token).
5. The initialization fails, so we have asked the user to log in again.
6. When the user tries to log in we are going `Network Error` at the `triggerTransaction` method of SDK. Moreover, it's not showing any error info except `Network Error`.
Can you help us to resolve this issue?
Posted by Hafeezul Kareem over 2 years ago
Smallcase Webhook integration data
Hi, in the webhook integration, is the notification sent by your api going to be for the orders that were placed only on our Gateway?
Posted by Nipun Ramani over 2 years ago
Securities Transaction: Basket Order
Hi Team,
I have some questions about securities transaction API when we place a basket order:
1.
If I place a basket order with securities transaction API, what will be the order update trigger that I'll receive via single stock update webhook?
Let's say, the basket order contains 4 stocks in the securities list. Will I receive four separate updates as and when those orders are completed or a single update when all of them are completed?
Let's say if one stock order is completed successfully, will I get the all four orders in the order update trigger with the schema something like this:
{
...
orders: {
"stock1": { "status": "COMPLETED", ... },
"stock2": { "status": "PLACED", ... },
"stock3": { "status": "PLACED", ... },
"stock4": { "status": "PLACED", ... }
}
...
}
OR only the completed order with schema something like this:
{
...
orders: {
"stock1": { "status": "COMPLETED", ... }
}
...
}
2.
Is it checking for the validity of funds to place all the stock orders in the securities list of the basket?
For ex. If 2 stock orders are completed and now the user doesn't have enough funds to place other two stock orders.
Posted by Meet Patel almost 2 years ago
Where and How to register for webhook api at smallcase
Hi, do we have developer console where we can submit our public webhook api
Posted by Akash over 2 years ago