Cancel order
curl --request PUT \
--url https://apiweb.mile.app/api/v4/order/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Customer cancelled the order"
}
'import requests
url = "https://apiweb.mile.app/api/v4/order/{id}/cancel"
payload = { "reason": "Customer cancelled the order" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Customer cancelled the order'})
};
fetch('https://apiweb.mile.app/api/v4/order/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v4/order/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Customer cancelled the order'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v4/order/{id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"Customer cancelled the order\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apiweb.mile.app/api/v4/order/{id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Customer cancelled the order\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/order/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Customer cancelled the order\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Order cancelled",
"data": {
"order": {
"_id": "6710c3d4e5f6a7b8c9d0e1f2",
"orderTypeId": "6710a2f4c1d2e3f4a5b6c7d8",
"orderTypeName": "Express Delivery",
"orderTypeVersion": 2,
"orderRefNumber": "EXP-0001",
"externalRef": "SO-2026-1001",
"hubId": "64d9932e2beb9037735ff022",
"hubName": "Jakarta Hub",
"status": "cancelled",
"statusLabel": "Cancelled",
"statusCategory": "completed",
"isFinal": true,
"values": {
"orderNo": "EXP-0001",
"customerName": "Rina",
"weight": 2.5
},
"createdFrom": "API",
"sourceTaskId": null,
"attention": null,
"activeSteps": [],
"taskSummary": {
"total": 1,
"open": 1,
"done": 0
},
"createdTime": "2026-10-16T02:00:00.000+00:00",
"createdBy": "[email protected]",
"updatedTime": "2026-10-16T02:01:00.000+00:00",
"statusUpdatedTime": "2026-10-16T02:01:00.000+00:00"
},
"tasks": [
{
"taskId": "6710d1e2f3a4b5c6d7e8f901",
"status": "UNASSIGNED",
"action": "deleted"
}
]
},
"warnings": []
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Order
Cancel order
Moves an order to the order type’s cancel status and makes it final. Requires permission edit/order.
Open tasks of the order that were not started are deleted; tasks already in progress are left open and listed in warnings (ord-094). Refused with 409 when the order is already final or the order type has no cancel status.
PUT
/
order
/
{id}
/
cancel
Cancel order
curl --request PUT \
--url https://apiweb.mile.app/api/v4/order/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Customer cancelled the order"
}
'import requests
url = "https://apiweb.mile.app/api/v4/order/{id}/cancel"
payload = { "reason": "Customer cancelled the order" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Customer cancelled the order'})
};
fetch('https://apiweb.mile.app/api/v4/order/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v4/order/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Customer cancelled the order'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v4/order/{id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"Customer cancelled the order\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apiweb.mile.app/api/v4/order/{id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Customer cancelled the order\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/order/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Customer cancelled the order\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Order cancelled",
"data": {
"order": {
"_id": "6710c3d4e5f6a7b8c9d0e1f2",
"orderTypeId": "6710a2f4c1d2e3f4a5b6c7d8",
"orderTypeName": "Express Delivery",
"orderTypeVersion": 2,
"orderRefNumber": "EXP-0001",
"externalRef": "SO-2026-1001",
"hubId": "64d9932e2beb9037735ff022",
"hubName": "Jakarta Hub",
"status": "cancelled",
"statusLabel": "Cancelled",
"statusCategory": "completed",
"isFinal": true,
"values": {
"orderNo": "EXP-0001",
"customerName": "Rina",
"weight": 2.5
},
"createdFrom": "API",
"sourceTaskId": null,
"attention": null,
"activeSteps": [],
"taskSummary": {
"total": 1,
"open": 1,
"done": 0
},
"createdTime": "2026-10-16T02:00:00.000+00:00",
"createdBy": "[email protected]",
"updatedTime": "2026-10-16T02:01:00.000+00:00",
"statusUpdatedTime": "2026-10-16T02:01:00.000+00:00"
},
"tasks": [
{
"taskId": "6710d1e2f3a4b5c6d7e8f901",
"status": "UNASSIGNED",
"action": "deleted"
}
]
},
"warnings": []
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Authorizations
Use a valid Bearer token to authenticate.
Path Parameters
Unique identifier for the order that generated by system.
Example: 6710c3d4e5f6a7b8c9d0e1f2
Body
application/json
Why the order is cancelled. Max 500 characters.