Integration Docs

Comprehensive guide and documentation to help you start working with smallcase Gateway

Get Started

Transaction Responses

Single stock or Basket Order response (SST)

Response enums (SST)

{
  "smallcaseAuthToken": "String",
  "transactionId": "String",
  "broker": "String",
  "notes": "256 char string, if sent while creating transaction",
  "orderBatches": [
    {
      // a batch represents a single SST order containing one or more stocks
      "batchId": "String",
      "transactionId": "String",
      "quantity": "Number",
      "filled": "Number",
      "buyAmount": "Number",
      "sellAmount": "Number",
      "completedDate": "Date",
      "status": {
        "type": "String",
        "enumValues": [
          "COMPLETED", // bacth executed successfully
          "MARKEDCOMPLETE", // one or more orders in batch didn't went through
          "PLACED", // AMO/Limit order placed succesfully
          "UNPLACED", // Order was rejected by broker, and was not placed on exchange
          "PARTIALLYPLACED", // Only some orders in AMO batch got placed
          "ERROR" // No order in the batch got placed
        ]
      },
      // an order represent each individual stock in the batch
      "orders": [
        {
          "exchangeOrderId": "String",
          // status of the individual stock order
          "status": {
            "type": "String",
            "enumValues": [
              "PLACED", // AMO/Limit order placed successfully
              "REJECTED", // Order was rejected by exchange
              "CANCELLED", // Unmatched order cancelled by system
              "COMPLETE", // Stock transaction successful
              "CANCELLED AMO", // AMO order cancelled by user
              "PARTIAL" // Partial quantity got filled
            ]
          },
          "tradingsymbol": "String",
          "quantity": "Number",
          "filledQuantity": "Number",
          "averagePrice": "Number",
          "orderType": {
            "type": "String",
            "enumValues": [
              "MARKET",
              "LIMIT"
            ]
          },
          "transactionType": "String",
          "product": {
            "type": "String",
            "enumValues": [
              "CNC"
            ]
          },
          "exchange": {
            "type": "String",
            "enumValues": [
              "NSE"
            ]
          }
        }
      ],
      "unplaced": [
        {
          "exchangeOrderId": "String",
          "status": {
            "type": "String",
            "enumValues": [
              "ERROR"
            ]
          },
          "tradingsymbol": "String",
          "quantity": "Number",
          "filledQuantity": "Number",
          "averagePrice": "Number",
          "orderType": {
            "type": "String",
            "enumValues": [
              "MARKET",
              "LIMIT"
            ]
          },
          "transactionType": "String",
          "product": {
            "type": "String",
            "enumValues": [
              "CNC",
              "NRML"
            ]
          },
          "exchange": {
            "type": "String",
            "enumValues": [
              "NSE",
              "BSE"
            ]
          }
        }
      ],
      "variety": {
        "type": "String",
        "enumValues": [
          "amo",
          "regular"
        ]
      }
    }
  ]
}

Sample market order responses (SST)

{
    "smallcaseAuthToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MTFhMjE0NjVmYzFhZjIyMzUzYzEzOTUiLCJpYXQiOjE2MjkxMDI0NzksImV4cCI6MTYyOTEwNjA3OX0.XpDkGQt5quB3sxh2ZmOy818Ej3KIFetVM9INyZt3AlQ",
    "notes":"all to be complete",
    "broker":"kite",
    "transactionId":"TRX_47fbd57104814ddd9d57af8ae6556024",
    "orderBatches":[
        {
            "filled":2,
            "variety":"regular",
            "buyAmount":22050.62,
            "sellAmount":0,
            "orders":[
                {
                    "orderType":"MARKET",
                    "product":"CNC",
                    "exchange":"NSE",
                    "status":"COMPLETE",
                    "quantity":1,
                    "tradingsymbol":"ITC",
                    "transactionType":"BUY",
                    "filledQuantity":1,
                    "averagePrice":211.02,
                    "exchangeOrderId":"611a212f053f50b5bca67bd3611a2173053f50b5bca67bf5"
                },
                {
                    "orderType":"MARKET",
                    "product":"CNC",
                    "exchange":"NSE",
                    "status":"COMPLETE",
                    "quantity":10,
                    "tradingsymbol":"RELIANCE",
                    "transactionType":"BUY",
                    "filledQuantity":10,
                    "averagePrice":2183.96,
                    "exchangeOrderId":"611a212f053f50b5bca67bd3611a2173053f50b5bca67bf3"
                }
            ],
            "unplaced":[
                
            ],
            "batchId":"611a21737f8bf5d33e986067",
            "quantity":2,
            "status":"COMPLETED",
            "completedDate":"2021-08-16T08:27:34.213Z",
            "transactionId":"TRX_47fbd57104814ddd9d57af8ae6556024"
        }
    ]
}
{
    "smallcaseAuthToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MTFhMjE0NjVmYzFhZjIyMzUzYzEzOTUiLCJpYXQiOjE2MjkxMDI1OTQsImV4cCI6MTYyOTEwNjE5NH0.Gu3vK3s6Ru-6z8q9oWLfR6d4oLf2Mnd_elxH46BFlw8",
    "notes":"two of three completed will make txn MARKEDCOMPLETE",
    "broker":"kite",
    "transactionId":"TRX_8575d8bb5a464ef1b5e56cfd598acc63",
    "orderBatches":[
        {
            "filled":5,
            "variety":"regular",
            "buyAmount":38410.21,
            "sellAmount":0,
            "orders":[
                {
                    "orderType":"MARKET",
                    "product":"CNC",
                    "exchange":"NSE",
                    "status":"CANCELLED",
                    "quantity":10,
                    "tradingsymbol":"ITC",
                    "transactionType":"BUY",
                    "filledQuantity":0,
                    "averagePrice":246.00300000000001,
                    "exchangeId":1100000004830698
                },
                {
                    "orderType":"MARKET",
                    "product":"CNC",
                    "exchange":"NSE",
                    "status":"COMPLETE",
                    "quantity":10,
                    "tradingsymbol":"HDFCBANK",
                    "transactionType":"BUY",
                    "filledQuantity":10,
                    "averagePrice":1244.996,
                    "exchangeId":1100000004830698
                },
                {
                    "orderType":"MARKET",
                    "product":"CNC",
                    "exchange":"NSE",
                    "status":"COMPLETE",
                    "quantity":10,
                    "tradingsymbol":"TCS",
                    "transactionType":"BUY",
                    "filledQuantity":10,
                    "averagePrice":2121.02,
                    "exchangeId":1100000004830698
                }
            ],
            "unplaced":[
                {
                    "exchange":"NSE",
                    "status":"ERROR",
                    "quantity":2,
                    "tradingsymbol":"ASIANPAINT",
                    "transactionType":"BUY"
                }
            ],
            "batchId":"611a21fc7f8bf5d33e986091",
            "quantity":2,
            "status":"MARKEDCOMPLETE",
            "completedDate":"2021-08-16T08:29:51.808Z",
            "transactionId":"TRX_8575d8bb5a464ef1b5e56cfd598acc63"
        }
    ]
}
{
    "smallcaseAuthToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MTU0NzIzYWY4NjBjYjVhOWM3ZjE0YWYiLCJpYXQiOjE2MzI5MjQyMjgsImV4cCI6MTYzMjkyNzgyOH0.Hva3Cs5WgaZnG44Y2-Dw5dOHJL_1NwrqowAQGGi7p_4",
    "notes":"this is amo order, say hi!",
    "broker":"aliceblue",
    "transactionId":"TRX_12d5e47184864d69b1eba275a4cbb9eb",
    "orderBatches":[
        {
            "filled":0,
            "variety":"amo",
            "buyAmount":0,
            "sellAmount":0,
            "orders":[
                {
                    "orderType":"MARKET",
                    "product":"CNC",
                    "exchange":"NSE",
                    "status":"PLACED",
                    "quantity":1,
                    "tradingsymbol":"INFY",
                    "transactionType":"BUY"
                },
                {
                    "orderType":"MARKET",
                    "product":"CNC",
                    "exchange":"NSE",
                    "status":"PLACED",
                    "quantity":1,
                    "tradingsymbol":"ITC",
                    "transactionType":"BUY"
                }
            ],
            "unplaced":[
                
            ],
            "batchId":"6154723c606b0f3ada8277df",
            "quantity":2,
            "status":"PLACED",
            "transactionId":"TRX_12d5e47184864d69b1eba275a4cbb9eb"
        }
    ]
}
{
    "smallcaseAuthToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI1ZWYzMzcwNWY2MTBmODBiNTQ1M2IzMTkiLCJpYXQiOjE2MjkxMDIzMzgsImV4cCI6MTYyOTEwNTkzOH0.8sH-6nQzSocohsi51gSwQyKvrAzUvc9-enZyd_FS7xE",
    "notes":"placing a limit order",
    "broker":"kite",
    "transactionId":"TRX_26261c34160d42b599ff115085825750",
    "orderBatches":[
        {
            "filled":0,
            "variety":"regular",
            "buyAmount":0,
            "sellAmount":0,
            "orders":[
                {
                    "orderType":"LIMIT",
                    "product":"CNC",
                    "exchange":"NSE",
                    "status":"PLACED",
                    "quantity":1,
                    "tradingsymbol":"ITC",
                    "transactionType":"BUY"
                }
            ],
            "unplaced":[
                
            ],
            "batchId":"611a20f50e6c5b6e28d9c7b4",
            "quantity":1,
            "status":"PLACED",
            "transactionId":"TRX_26261c34160d42b599ff115085825750"
        }
    ]
}
{
    "smallcaseAuthToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MTFhMjE0NjVmYzFhZjIyMzUzYzEzOTUiLCJpYXQiOjE2MjkxMDI1MDMsImV4cCI6MTYyOTEwNjEwM30.wogl7AsPXOuI9ojON2r8Zn4R6W64tZsbCqIzMgk3ZlA",
    "notes":"to be UNPLACED",
    "broker":"kite",
    "transactionId":"TRX_20e788ed91c94f31aa98895f3fb7bb47",
    "orderBatches":[
        {
            "filled":0,
            "variety":"regular",
            "buyAmount":0,
            "sellAmount":0,
            "orders":[
                
            ],
            "unplaced":[
                {
                    "exchange":"NSE",
                    "status":"ERROR",
                    "quantity":1,
                    "tradingsymbol":"ITC",
                    "transactionType":"BUY"
                },
                {
                    "exchange":"NSE",
                    "status":"ERROR",
                    "quantity":10,
                    "tradingsymbol":"RELIANCE",
                    "transactionType":"BUY"
                }
            ],
            "batchId":"611a21a00e6c5b6e28d9c7df",
            "quantity":2,
            "status":"UNPLACED",
            "completedDate":"2021-08-16T08:28:16.101Z",
            "transactionId":"TRX_20e788ed91c94f31aa98895f3fb7bb47"
        }
    ]
}

📘

Identify if the order was placed as Market or AMO

Please note that variety = amo is used to identify if the order was after market order. Successful after market order will have status as PLACED.
In this case the order will be executed in the next trading session

If the variety = regular, order was placed as market order. Status response for a successful order in this case can be COMPLETE


smallcase order response (SMT)

Response enums (SMT)

{
  "notes": "String",
  "smallcaseAuthToken": "String",
  "broker": "String",
  "transactionId": "String",
  "orderBatches": [
    {
      "label": {
        "type": "String",
        "enumValues": [
          "BUY",
          "INVESTMORE",
          "REBALANCE",
          "SIP",
          "MANAGE",
          "PARTIALEXIT",
          "SELLALL",
          "FIX"
        ]
      },
      "originalLabel": {
        "type": "String",
        "enumValues": [
          "BUY",
          "INVESTMORE",
          "REBALANCE",
          "SIP",
          "MANAGE",
          "PARTIALEXIT",
          "SELLALL",
          "FIX"
        ]
      },
      "status": "COMPLETED",
      "variety": {
        "type": "String",
        "enumValues": [
          "amo",
          "regular"
        ]
      },
      "buyAmount": "Number",
      "sellAmount": "Number",
      "completedDate": "Date",
      "quantity": "Number",
      "filled":" Number",
      "batchId": "String",
      "orders":[
        {
          "exchangeOrderId": "String",
          "orderType": {
            "type": "String",
            "enumValues": [
              "MARKET",
              "LIMIT"
            ]
          },
          "product": {
            "type": "String",
            "enumValues": [
              "CNC"
            ]
          },
          "exchange": {
            "type": "String",
            "enumValues": [
              "NSE"
            ]
          },
          "status": {
            "type": "String",
            "enumValues": [
              "PLACED",
              "REJECTED",
              "CANCELLED",
              "COMPLETE",
              "ERROR",
              "CANCELLED AMO",
              "PARTIAL"
            ]
          },
          "quantity": "Number",
          "tradingsymbol": "String",
          "transactionType": {
            "type": "String",
            "enumValues": [
              "BUY",
              "SELL"
            ]
          },
          "filledQuantity": "Number",
          "averagePrice": "Number"
        }
      ],
      "unplaced": []
    }
  ]
}

Sample order response (SMT)

{
  "notes": "Buying a smallcase",
  "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MGZlYjZiNmJhM2YzMDkyZDA1NGM0NTkiLCJpYXQiOjE2MjczMDY2MjQsImV4cCI6MTYyNzMxMDIyNH0.E7eMYVMZAa1sl2JKAEzQl2yTPlVJkIQVSpp1ytlRadg",
  "broker": "kite",
  "transactionId": "TRX_3ed892feb6634e0a8860ed39acefea3d",
  "orderBatches": [
    {
      "label": "BUY",
      "originalLabel": "BUY",
      "status": "COMPLETED",
      "transactionId": "TRX_3ed892feb6634e0a8860ed39acefea3d",
      "variety": "regular",
      "buyAmount": 579.02,
      "sellAmount": 0,
      "completedDate": "2021-07-26T13:36:56.625Z",
      "quantity": 2,
      "filled": 2,
      "batchId": "60feba6fba3f3092d054c460",
      "orders": [
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "ICICINIFTY",
          "transactionType": "BUY",
          "filledQuantity": 1,
          "averagePrice": 169
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "JUNIORBEES",
          "transactionType": "BUY",
          "filledQuantity": 1,
          "averagePrice": 410.02
        }
      ],
      "unplaced": []
    }
  ]
}
{
  "notes": "Investing more in an already bought (invested) smallcase",
  "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MGZlYjZiNmJhM2YzMDkyZDA1NGM0NTkiLCJpYXQiOjE2MjczMDcxMDcsImV4cCI6MTYyNzMxMDcwN30.VofIa5lpfa_4f40AokzEf43-vsrj-wzm8gH99pRqM8o",
  "broker": "kite",
  "transactionId": "TRX_ee8d039e44ae40d8a7712eec14468866",
  "orderBatches": [
    {
      "label": "INVESTMORE",
      "originalLabel": "INVESTMORE",
      "status": "COMPLETED",
      "transactionId": "TRX_ee8d039e44ae40d8a7712eec14468866",
      "variety": "regular",
      "buyAmount": 579.03,
      "sellAmount": 0,
      "completedDate": "2021-07-26T13:44:56.948Z",
      "quantity": 2,
      "filled": 2,
      "batchId": "60febc4eba3f3092d054c461",
      "orders": [
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "ICICINIFTY",
          "transactionType": "BUY",
          "filledQuantity": 1,
          "averagePrice": 169.01
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "JUNIORBEES",
          "transactionType": "BUY",
          "filledQuantity": 1,
          "averagePrice": 410.02
        }
      ],
      "unplaced": []
    }
  ]
}
{
  "notes": "Manageing invested smallcase",
  "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MGZlYjZiNmJhM2YzMDkyZDA1NGM0NTkiLCJpYXQiOjE2MjczMDcyNzUsImV4cCI6MTYyNzMxMDg3NX0.0eiAGODAjJb2OH2h3URxT_uMeS-85LMtbEl8PE1qHHc",
  "broker": "kite",
  "transactionId": "TRX_e2d0c1367b1c4421918173677ab32f60",
  "orderBatches": [
    {
      "label": "MANAGE",
      "originalLabel": "MANAGE",
      "status": "COMPLETED",
      "transactionId": "TRX_e2d0c1367b1c4421918173677ab32f60",
      "variety": "regular",
      "buyAmount": 169.01,
      "sellAmount": 410.02,
      "completedDate": "2021-07-26T13:47:47.240Z",
      "quantity": 2,
      "filled": 2,
      "batchId": "60febcfbba3f3092d054c462",
      "orders": [
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "ICICINIFTY",
          "transactionType": "BUY",
          "filledQuantity": 1,
          "averagePrice": 169.01
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "JUNIORBEES",
          "transactionType": "SELL",
          "filledQuantity": 1,
          "averagePrice": 410.02
        }
      ],
      "unplaced": []
    }
  ]
}
{
  "notes": "Placing sip order",
  "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MGZlYmZmM2IzYjc4N2YzYzBjYzQzOTEiLCJpYXQiOjE2Mjc2MjQxMTMsImV4cCI6MTYyNzYyNzcxM30.yy9GFHYghtYzh7u5ly5i4bN_zAERpt-dho_axLpN0co",
  "broker": "fivepaisa",
  "transactionId": "TRX_e73e9a6d05fa481ca1591c5322ffb8ad",
  "orderBatches": [
    {
      "label": "SIP",
      "originalLabel": "SIP",
      "status": "COMPLETED",
      "transactionId": "TRX_e73e9a6d05fa481ca1591c5322ffb8ad",
      "variety": "regular",
      "buyAmount": 7311.01,
      "sellAmount": 0,
      "completedDate": "2021-07-30T05:48:20.490Z",
      "quantity": 8,
      "filled": 8,
      "batchId": "610392a1c60b5b3e3f732687",
      "orders": [
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 2,
          "tradingsymbol": "INFY",
          "transactionType": "BUY",
          "filledQuantity": 2,
          "averagePrice": 1611.96
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "SBIN",
          "transactionType": "BUY",
          "filledQuantity": 1,
          "averagePrice": 433
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "TATAMOTORS",
          "transactionType": "BUY",
          "filledQuantity": 1,
          "averagePrice": 298.01
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 24,
          "tradingsymbol": "YESBANK",
          "transactionType": "BUY",
          "filledQuantity": 24,
          "averagePrice": 12
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "IDFCFIRSTB",
          "transactionType": "BUY",
          "filledQuantity": 1,
          "averagePrice": 52
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 2,
          "tradingsymbol": "AXISBANK",
          "transactionType": "BUY",
          "filledQuantity": 2,
          "averagePrice": 713.04
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 2,
          "tradingsymbol": "ITC",
          "transactionType": "BUY",
          "filledQuantity": 2,
          "averagePrice": 204.99
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 2,
          "tradingsymbol": "WIPRO",
          "transactionType": "BUY",
          "filledQuantity": 2,
          "averagePrice": 590.01
        }
      ],
      "unplaced": []
    }
  ]
}
{
  "notes": " Rebalancing smallcase",
  "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MTA3OTIwNjY5MWZkYTJmZTc5ZWU5ZDciLCJpYXQiOjE2Mjc4ODY3ODksImV4cCI6MTYyNzg5MDM4OX0.jQ4TRML1nQRQvVe5pLRaf5ahuUs0ZF-gZijdtiw2km0",
  "broker": "kite",
  "transactionId": "TRX_11799aa5e9354540bc47af3dbdb164e3",
  "orderBatches": [
    {
      "label": "REBALANCE",
      "originalLabel": "REBALANCE",
      "status": "COMPLETED",
      "transactionId": "TRX_11799aa5e9354540bc47af3dbdb164e3",
      "variety": "regular",
      "buyAmount": 5101,
      "sellAmount": 5200,
      "completedDate": "2021-08-02T06:46:21.420Z",
      "quantity": 3,
      "filled": 3,
      "batchId": "610794b8691fda2fe79ee9e0",
      "orders": [
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 315,
          "tradingsymbol": "IDEA",
          "transactionType": "BUY",
          "filledQuantity": 315,
          "averagePrice": 8
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 89,
          "tradingsymbol": "MOM100",
          "transactionType": "BUY",
          "filledQuantity": 89,
          "averagePrice": 29
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 100,
          "tradingsymbol": "IDFCFIRSTB",
          "transactionType": "SELL",
          "filledQuantity": 100,
          "averagePrice": 52
        }
      ],
      "unplaced": []
    }
  ]
}
/**
 * Note: txn id is to be created with orderConfig.type=EXIT
 *
 * User will have option to either partially exit or fully exit the smallcase in the orderflow
 * Below is sample response when user opts to partially sell the smallcase
 */
{
  "notes": " Partially Exiting invested smallcase",
  "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MGZlYmZmM2IzYjc4N2YzYzBjYzQzOTEiLCJpYXQiOjE2Mjc1Mzk2NDgsImV4cCI6MTYyNzU0MzI0OH0.XJSPsG7kpkpOtMH0oHMjwEF1JSOWQSTCqMQZyDJkjG8",
  "broker": "upstox",
  "transactionId": "TRX_68311f303d474a528aecf044bb3796f2",
  "orderBatches": [
    {
      "label": "PARTIALEXIT",
      "originalLabel": "PARTIALEXIT",
      "status": "COMPLETED",
      "transactionId": "TRX_68311f303d474a528aecf044bb3796f2",
      "variety": "regular",
      "buyAmount": 0,
      "sellAmount": 215.99,
      "completedDate": "2021-07-29T06:20:40.702Z",
      "quantity": 2,
      "filled": 2,
      "batchId": "610248b561c4f0bc65733d8b",
      "orders": [
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "ICICILOVOL",
          "transactionType": "SELL",
          "filledQuantity": 1,
          "averagePrice": 130
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "ICICINV20",
          "transactionType": "SELL",
          "filledQuantity": 1,
          "averagePrice": 85.99
        }
      ],
      "unplaced": []
    }
  ]
}
/**
 * Note: txn id is to be created with orderConfig.type=EXIT
 *
 * User will have option to either partially exit or fully exit the smallcase in the orderflow
 * Below is sample response when user opts to fully sell the smallcase
 */
{
  "notes": "Exiting invested smallcase",
  "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MGZlYmZmM2IzYjc4N2YzYzBjYzQzOTEiLCJpYXQiOjE2Mjc1Mzk4ODQsImV4cCI6MTYyNzU0MzQ4NH0.gRLNTkoqSwAWcZT10cvn5UO_RtpCQCDkVS2kEBpN5bk",
  "broker": "upstox",
  "transactionId": "TRX_7df53a3bfeaf4d828e0ab429a894ac4c",
  "orderBatches": [
    {
      "label": "SELLALL",
      "originalLabel": "SELLALL",
      "status": "COMPLETED",
      "transactionId": "TRX_7df53a3bfeaf4d828e0ab429a894ac4c",
      "variety": "regular",
      "buyAmount": 0,
      "sellAmount": 216.01,
      "completedDate": "2021-07-29T06:24:37.155Z",
      "quantity": 2,
      "filled": 2,
      "batchId": "610249a26f5accf2e38d0b2e",
      "orders": [
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "ICICILOVOL",
          "transactionType": "SELL",
          "filledQuantity": 1,
          "averagePrice": 130
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1,
          "tradingsymbol": "ICICINV20",
          "transactionType": "SELL",
          "filledQuantity": 1,
          "averagePrice": 86.01
        }
      ],
      "unplaced": []
    }
  ]
}
/*
 * There can be cases when user is trying to do a smallcase TXN of type A,
 * but due to some pending action, they had to complete pending acion before doing the originally intended transaction (type A).
 *
 * Moreover, it can be the case that the order was not fully completed, and user does some additional action during the same txn.
 
 * Here's the sample response for BUY + REPAIR scenario -
 * While BUYing the smallcase, the order was partially filled. So user subsequently REPAIRed the smallcase during the same transaction.
 */
{
  "notes": "Buying a smallcase",
  "smallcaseAuthToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI2MGZlYmZmM2IzYjc4N2YzYzBjYzQzOTEiLCJpYXQiOjE2Mjc1Mzk2NDgsImV4cCI6MTYyNzU0MzI0OH0.XJSPsG7kpkpOtMH0oHMjwEF1JSOWQSTCqMQZyDJkjG8",
  "broker": "upstox",
  "transactionId": "TRX_0dd60dfe6a8c448297cb57c94c2e95ec",
  "orderBatches": [
    {
      "label": "BUY",
      "originalLabel": "BUY",
      "status": "FIXED",
      "transactionId": "TRX_0dd60dfe6a8c448297cb57c94c2e95ec",
      "variety": "regular",
      "buyAmount": 41829.55,
      "sellAmount":0.0,
      "completedDate": "2021-07-07T05: 55: 16.572Z",
      "quantity": 6.0,
      "filled": 4.0,
      "batchId": "60e541c199a5de24ebaf1e5b",
      "orders": [
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 3.0,
          "tradingsymbol": "WSTCSTPAPR",
          "transactionType": "BUY",
          "filledQuantity": 3.0,
          "averagePrice": 278.0
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "PARTIAL",
          "quantity": 12.0,
          "tradingsymbol": "HSCL",
          "transactionType": "BUY",
          "filledQuantity": 11.0,
          "averagePrice": 55.0
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1.0,
          "tradingsymbol": "GULFOILLUB",
          "transactionType": "BUY",
          "filledQuantity": 1.0,
          "averagePrice": 688.97
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "PARTIAL",
          "quantity": 14.0,
          "tradingsymbol": "HCLTECH",
          "transactionType": "BUY",
          "filledQuantity": 13.0,
          "averagePrice": 970.0376923076924
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 25.0,
          "tradingsymbol": "WIPRO",
          "transactionType": "BUY",
          "filledQuantity": 25.0,
          "averagePrice": 533.9979999999999
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 13.0,
          "tradingsymbol": "TECHM",
          "transactionType": "BUY",
          "filledQuantity": 13.0,
          "averagePrice": 1057.0107692307693
        }
      ],
      "unplaced": []
    },
    {
      "label": "FIX",
      "originalLabel": "BUY",
      "status": "COMPLETED",
      "transactionId": "TRX_01c3a30bb1704892922571c063d69b6c",
      "variety": "regular",
      "buyAmount": 1026.04,
      "sellAmount":0.0,
      "completedDate": "2021-07-07T05: 55: 47.190Z",
      "quantity": 2.0,
      "filled": 2.0,
      "batchId": "60e541e099a5de24ebaf1e7d",
      "orders": [
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1.0,
          "tradingsymbol": "HSCL",
          "transactionType": "BUY",
          "filledQuantity": 1.0,
          "averagePrice": 55.0
        },
        {
          "orderType": "MARKET",
          "product": "CNC",
          "exchange": "NSE",
          "status": "COMPLETE",
          "quantity": 1.0,
          "tradingsymbol": "HCLTECH",
          "transactionType": "BUY",
          "filledQuantity": 1.0,
          "averagePrice": 971.04
        }
      ],
      "unplaced": []
    }
  ]
}

Broker Holdings response

{
    "success": true,
    "errors": null,
    "data": {
        "smallcases": {
            "public": [
                {
                    "scid": "SCAW_0001",
                    "name": "All Weather Investing",
                    "investmentDetailsURL": "https://smallcase.zerodha.com/details/5f2d22636678954954f29a2d?",
                    "shortDescription": "Diversify with equity, gold & fixed income ETFs for recession-proof investing",
                    "imageUrl": "https://assets.smallcase.com/images/smallcases/200/SCAW_0001.png",
                    "stats": {
                        "currentValue": 4921.89,
                        "totalReturns": -36.65253999999927
                    },
                    "constituents": [
                        {
                            "ticker": "NIFTYBEES",
                            "shares": 10
                        },
                        {
                            "ticker": "JUNIORBEES",
                            "shares": 3
                        },
                        {
                            "ticker": "LIQUIDBEES",
                            "shares": 1
                        },
                        {
                            "ticker": "GOLDBEES",
                            "shares": 39
                        }
                    ]
                }
            ],
            "private": {
                "stats": {
                    "currentValue": 0,
                    "totalReturns": 0
                }
            }
        },
        "securities": {
            "holdings": [
                {
                    "ticker": "ABFRL",
                    "shares": 8,
                    "name": "Aditya Birla Fashion and Retail Ltd",
                    "exchange": "NSE",
                    "averagePrice": 163.8
                },
                {
                    "ticker": "HDFCBANK",
                    "shares": 2,
                    "name": "HDFC Bank Ltd",
                    "exchange": "BSE",
                    "averagePrice": 1232.65
                },
                {
                    "ticker": "ICICIBANK",
                    "shares": 4,
                    "name": "ICICI Bank Ltd",
                    "exchange": "BSE",
                    "averagePrice": 416.1875
                },
                {
                    "ticker": "ICICILOVOL",
                    "shares": 2,
                    "name": "ICICI Prudential Nifty 100 Low Vol 30 ETF",
                    "exchange": "BSE",
                    "averagePrice": 94.87
                },
                {
                    "ticker": "ICICINIFTY",
                    "shares": 51,
                    "name": "ICICI Prudential Nifty 50 ETF",
                    "exchange": "NSE",
                    "averagePrice": 82.478431
                },
                {
                    "ticker": "ICICINV20",
                    "shares": 2,
                    "name": "ICICI Prudential NV20 ETF",
                    "exchange": "BSE",
                    "averagePrice": 58.87
                },
                {
                    "ticker": "ICICINXT50",
                    "shares": 4,
                    "name": "ICICI Prudential Nifty Next 50 ETF",
                    "exchange": "BSE",
                    "averagePrice": 28.67
                },
                {
                    "ticker": "INFY",
                    "shares": 5,
                    "name": "Infosys Ltd",
                    "exchange": "BSE",
                    "averagePrice": 690.7
                },
                {
                    "ticker": "RELIANCE",
                    "shares": 16,
                    "name": "Reliance Industries Ltd",
                    "exchange": "BSE",
                    "averagePrice": 1909.69375
                }
            ]
        },
        "updating": false,
        "lastUpdate": "2020-11-05T08:12:16.799Z",
        "snapshotDate": "2020-11-05T08:12:16.799Z",
        "smallcaseAuthId": "5ee21fa8df87c51bab457f96"
    }
}

Updated 27 days ago


Transaction Responses


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.