DELETE/ipos/orders/:order_id
Cancel IPO Order
API to withdraw an IPO application. Identify the application by its order_id in the path — Apply IPO returns it in the response, and you can also read it from Get IPO Orders or Get IPO Order Details.
Once the cancellation is accepted, the application reports status: application_deleted on Get IPO Order Details, with cancel_requested_date and cancel_accepted_date populated.
An application can only be withdrawn while the issue is still accepting bids. Once the bidding window closes — see bidding_end_date in Get IPO Details — the exchange no longer accepts withdrawal requests and the application proceeds to allotment.
Path Parameters
| Name | Required | Type | Description |
|---|---|---|---|
| order_id | Required | string | IPO application ID. Obtain it from data.order_id in Apply IPO or data[].order_id in Get IPO Orders. |
Request
curl --location --request DELETE 'https://api.upstox.com/v2/ipos/orders/UPROYAL00000003' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
For additional samples in various languages, please refer to the Sample code section on this page.
Responses
- 200
- 4XX
Response Body
{
"status": "success",
"data": {
"order_id": "UPROYAL00000003",
"status": "Application cancelled successfully"
}
}
| Name | Type | Description |
|---|---|---|
| status | string | Outcome of the request. Possible values: success, error, partial_success. |
| data.order_id | string | Application ID that was cancelled. |
| data.status | string | Free-text message returned by the IPO service for the cancellation request. Treat it as a display message, not a fixed value — check status on Get IPO Order Details to confirm the application reached application_deleted. |
Error codes
| Error code | Description |
|---|---|
| UDAPI1226 | id is required - The application ID is missing from the request. Obtain it from Get IPO Orders or the Apply IPO response. |
Sample Code
- Python
- Node.js
- Java
- PHP
import requests
order_id = 'UPROYAL00000003'
url = f'https://api.upstox.com/v2/ipos/orders/{order_id}'
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}
response = requests.delete(url, headers=headers)
print(response.json())
const axios = require('axios');
const orderId = 'UPROYAL00000003';
axios.delete(`https://api.upstox.com/v2/ipos/orders/${orderId}`, {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}
}).then(response => console.log(response.data))
.catch(error => console.error('Error:', error));
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class CancelIpoOrder {
public static void main(String[] args) throws Exception {
String orderId = "UPROYAL00000003";
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("https://api.upstox.com/v2/ipos/orders/" + orderId))
.header("Accept", "application/json")
.header("Authorization", "Bearer {your_access_token}")
.DELETE()
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$orderId = 'UPROYAL00000003';
$url = "https://api.upstox.com/v2/ipos/orders/{$orderId}";
$headers = [
'Accept: application/json',
'Authorization: Bearer {your_access_token}'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_errno($ch) ? print('Error: ' . curl_error($ch)) : print($response);
curl_close($ch);
?>