Full Order Cancellation | Climes API
This endpoint is useful to fully cancel an already existing order which is in locked state.
caution
This endpoint is only applicable for orders which are in locked state. This will return an error in case of order in unlocked state.
Request Parameters
Endpoint
For an order where the merchant is paying :
/v3/integrations/vote/order/{partner_order_id}/cancel
For an order where the customer is paying :
/v3/integrations/calculated/order/{partner_order_id}/cancel
Method
DELETE
Headers
{
'x-api-key' : 'API_KEY',
'Content-Type' : 'application/json'
}
Response Parameters
Status Code
200
Response Data
{
"message": "Order cancelled successfully",
"partner_order_id" : "876287372837786837"
}
Sample Request
- cURL
- NodeJs
- Axios
- Python
- Php
curl --location --request DELETE 'BASE_URL/v3/integrations/vote/order/876287372837786837/cancel'
--header 'x-api-key: API_KEY'
--header 'Content-Type: application/json'
const fetch = require('node-fetch');
const url = 'BASE_URL/v3/integrations/vote/order/876287372837786837/cancel';
const apiKey = 'API_KEY';
const headers = {
'x-api-key': apiKey,
'Content-Type': 'application/json'
};
const options = {
method: 'DELETE',
headers: headers,
body: JSON.stringify({})
};
fetch(url, options)
.then(response => response.text())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
var axios = require('axios');
var config = {
method: 'delete',
url: 'BASE_URL/v3/integrations/vote/order/876287372837786837/cancel',
headers: {
'x-api-key': 'API_KEY',
'Content-Type': 'application/json'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "BASE_URL/v3/integrations/vote/order/876287372837786837/cancel"
payload={}
headers = {
'x-api-key': 'API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('BASE_URL/v3/integrations/vote/order/876287372837786837/cancel');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => 'API_KEY',
'Content-Type' => 'application/json'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
Sample Response
Below are sample responses for the above request.
Responses
- Success - 200
- Failure - 400
{
"message": "Order cancelled successfully",
"partner_order_id": "876287372837786837"
}
{
"message": "Bad Request! Please send all the variables properly."
}