logo

How to Modify and Cancel Orders Using the HDFC SKY API

By HDFC SKY | Published at: Nov 5, 2026 04:49 PM IST

How to Modify and Cancel Orders Using the HDFC SKY API

Open Free Demat Account

By signing up I certify terms, conditions & privacy policy

After placing an order through the HDFC SKY API, you may need to update or cancel it before it is executed. This is common when market conditions change or your trading strategy needs adjustment. The HDFC SKY API allows developers to manage eligible orders programmatically, making applications more efficient and responsive. This guide explains how order modification and cancellation work, the conditions you need to meet, and the key points to remember before sending a request.

Why Modify or Cancel an Order?

Before learning the process, it is helpful to understand why these features are important. Not every order is executed immediately. If an order is still pending, you may want to change some of its details or cancel it altogether.

Common reasons include:

  • Adjusting the order price based on market movements.
  • Changing the order quantity.
  • Updating the order validity, where supported.
  • Cancelling an order that is no longer required.

Managing orders programmatically allows your application to respond quickly without requiring manual intervention.

What Do You Need Before You Begin?

Before modifying or cancelling an order, make sure your application meets the following requirements.

  • Have an active HDFC SKY trading account.
  • Register your application on the HDFC SKY Developer Portal.
  • Generate your API Key and API Secret.
  • Complete the authentication process and obtain a valid Access Token.
  • Configure the required Static IP Address, where applicable, in accordance with exchange requirements.
  • Have the unique order identifier for the order you want to modify or cancel.

Once these requirements are complete, your application can send authorised order management requests.

When Can You Modify an Order?

Not every order can be modified. In general, an order can only be modified while it is in a pending state. Once an order has been fully executed, cancelled, or rejected, it cannot be changed.

Before sending a modification request, your application should verify that the order is still eligible for modification.

Also Read: HDFC SKY API Rate Limits, Session Validity, and Token Management Explained

What Can You Modify in an Order?

If an order is eligible for modification, HDFC SKY allows certain order details to be updated.

Depending on the order type and exchange rules, you may be able to modify:

  • Order price
  • Order quantity
  • Order validity

The fields that can be updated depend on the order’s current status and the applicable trading rules.

How Does Order Modification Work?

The modification process follows a simple sequence.

First, your application authenticates the request using a valid Access Token. It then identifies the pending order using its unique order identifier and sends the updated order details through the appropriate HDFC SKY Modify Order API.

If the request satisfies the required validation checks, the platform updates the order successfully.

When Can You Cancel an Order?

An order can only be cancelled if it has not been completely executed.

Generally, only active and unfilled pending orders are eligible for cancellation. If the order has already been fully executed or cancelled, the cancellation request will not succeed.

Your application should always verify the latest order status before attempting to cancel an order.

How Does Order Cancellation Work?

The cancellation process is straightforward.

Your application authenticates the request using a valid Access Token and sends the unique order identifier to the HDFC SKY Cancel Order API.

If the order is still eligible for cancellation, HDFC SKY processes the request and updates the order status accordingly.

Authentication Requirements

Every order management request must be properly authenticated.

Before modifying or cancelling an order, ensure that:

  • Your Access Token is valid.
  • Your API Key is associated with the application.
  • The required authentication process has been completed.
  • Your application uses the registered configuration required for API access.

Without valid authentication, the platform will not process the request.

Why Is Static IP Configuration Important?

For supported API integrations, HDFC SKY requires a registered Static IP Address as part of its exchange compliance requirements.

The registered Static IP helps identify authorised applications and provides an additional layer of security for API communication.

Before sending order management requests, verify that your application’s Static IP configuration matches the details registered in the Developer Portal.

Good Practices for Order Management

Following a few simple practices can help your application manage orders more reliably.

Before modifying or cancelling an order, remember to:

  • Check the latest order status.
  • Confirm that the order is still pending.
  • Use a valid Access Token.
  • Verify the order identifier before sending the request.
  • Submit only the fields that need to be updated when modifying an order.
  • Handle API responses appropriately within your application.

These practices can help reduce errors and improve the overall reliability of your application.

Conclusion

The HDFC SKY API makes it easier to manage eligible orders without manual intervention. By understanding when an order can be modified or cancelled, completing the required authentication, and following the documented API workflow, developers can build applications that manage orders securely and efficiently while providing a smoother trading experience for users.

Summarize with AI
Google GeminiChatGPTPerplexity AIAnthropic AIGrok AI

Open Free Demat Account

By signing up I certify terms, conditions & privacy policy

Desktop BannerMobile Banner

Invest Anytime, Anywhere

Get it on Google PlayGet it on App Store

Open Free Demat Account Online

By signing up I certify terms, conditions & privacy policy