Securities transaction: order cancellation

With Securities transaction, user can place aftermarket orders and limit orders. There are two ways to open order cancellation:

  1. SDK's Show Orders method
    Users can view recent orders and cancel open orders on smallcase managed UI. You need not develop UI at your end to list orders.
  2. Trigger transaction with the intent of CANCEL_ORDER
    When users want to cancel any order (from your order listing UI), you can create and trigger transaction with a particular intent and open order details.

1. Show Orders method

With this, users can view recent orders. And they can choose to cancel any of the open orders. All the UI is powered by SDK.

More about implementation on the respective SDK page.

2. Cancel order

With this, users can cancel any of the open orders. The UI for order listing is not powered by SDK. SDK will only display the cancellation confirmation modal, and subsequent status modal.

Step 1. Create a transaction on server (with INTENT=CANCEL_ORDER)

Similar to securities order transaction, but with only different in request body:

{
     "intent": "CANCEL_ORDER",
     "orderConfig": {
          "batchId": "625fcf68d65636eb5b0004c8",
          "ticker": "RELIANCE"
     }
}

The batchId & ticker can be referenced from order response.

sample cURL request
curl --location --request POST 'https://gatewayapi.smallcase.com/gateway/gatewaydemo/transaction' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-gateway-authtoken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzbWFsbGNhc2VBdXRoSWQiOiI1ZjAzMjhiNWYzNzQwYzMxZDc1YWJkODUiLCJpYXQiOjE2NTA0NDYxNTAsImV4cCI6MTY1MDQ0OTc1MH0.Dq44ABmkD7o-sc9_B706OAC0sPyH5DfcicPcfOuzlzE' \
--header 'x-gateway-secret: gatewayDemo_secret' \
--data-raw '
{
     "intent": "CANCEL_ORDER",
     "orderConfig": {
          "batchId": "625fcf68d65636eb5b0004c8",
          "ticker": "RELIANCE"
     }
}
'

Note: Replace input parameters to match with your gateway and open order. Refer API reference for securities order transaction.

Step 2. Trigger transaction on SDK

Once the transactionId is generated, you can trigger the transaction on respective SDK. On trigger, SDK will ask user to confirm cancellation and subsequently display cancellation status.

1496