Cancel Payout
API to cancel a pending fund withdrawal (payout) request for the authenticated user. Only requests currently in RECEIVED status can be cancelled. Once a request moves to processing, it can no longer be cancelled. IMPS requests cannot be cancelled once initiated.
Request
curl --location --request DELETE 'https://api.upstox.com/v2/user/payments/payout/{transaction_id}' \
--header 'accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
Replace {transaction_id} with the transaction_id returned by the Payout Request API.
Additional samples in various languages are available in the Sample Code section on this page.
Responses
- 200
- 400
Response Body
{
"status": "success",
"data": {
"transaction_id": "ABC123XYZ-GC0173-7HIMPSABC",
"message": "Your withdrawal request of Amount 110.10 is deleted successfully."
}
}
| Name | Type | Description |
|---|---|---|
| status | string | Outcome of the request. |
| data | object | Cancellation confirmation record. |
| data.transaction_id | string | Unique identifier of the cancelled payout transaction. |
| data.message | string | User-facing confirmation message. |
Error codes
Errors follow the standard API error format.
| Error Code | Description |
|---|---|
| UDAPI100500 | Withdrawal request cannot be cancelled. The request may no longer be in received status. |
| UDAPI100500 | Transaction not found or does not belong to the authenticated user. |
Sample Code
Cancel payout
- Python
- Node.js
- Java
- PHP
import requests
transaction_id = 'ABC123XYZ-GC0173-7HIMPSABC'
url = f'https://api.upstox.com/v2/user/payments/payout/{transaction_id}'
headers = {
'accept': 'application/json',
'Authorization': 'Bearer {your_access_token}',
}
print(requests.delete(url, headers=headers).json())
const axios = require('axios');
const transactionId = 'ABC123XYZ-GC0173-7HIMPSABC';
axios.delete(`https://api.upstox.com/v2/user/payments/payout/${transactionId}`, {
headers: {
accept: 'application/json',
Authorization: 'Bearer {your_access_token}',
},
}).then(r => console.log(r.data));
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String transactionId = "ABC123XYZ-GC0173-7HIMPSABC";
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.upstox.com/v2/user/payments/payout/" + transactionId))
.header("accept", "application/json")
.header("Authorization", "Bearer {your_access_token}")
.DELETE()
.build();
System.out.println(HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()).body());
}
}
<?php
$transactionId = 'ABC123XYZ-GC0173-7HIMPSABC';
$url = "https://api.upstox.com/v2/user/payments/payout/{$transactionId}";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'accept: application/json',
'Authorization: Bearer {your_access_token}',
]);
echo curl_exec($ch);
curl_close($ch);
Loading...