curl --request PUT \
--url https://apiweb.mile.app/api/v4/order/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"values": {
"weight": 3
},
"expectedUpdatedTime": "2026-10-16T02:01:00.000+00:00"
}
'import requests
url = "https://apiweb.mile.app/api/v4/order/{id}"
payload = {
"values": { "weight": 3 },
"expectedUpdatedTime": "2026-10-16T02:01:00.000+00:00"
}
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({values: {weight: 3}, expectedUpdatedTime: '2026-10-16T02:01:00.000+00:00'})
};
fetch('https://apiweb.mile.app/api/v4/order/{id}', 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}",
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([
'values' => [
'weight' => 3
],
'expectedUpdatedTime' => '2026-10-16T02:01:00.000+00:00'
]),
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}"
payload := strings.NewReader("{\n \"values\": {\n \"weight\": 3\n },\n \"expectedUpdatedTime\": \"2026-10-16T02:01:00.000+00:00\"\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}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"values\": {\n \"weight\": 3\n },\n \"expectedUpdatedTime\": \"2026-10-16T02:01:00.000+00:00\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/order/{id}")
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 \"values\": {\n \"weight\": 3\n },\n \"expectedUpdatedTime\": \"2026-10-16T02:01:00.000+00:00\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Order updated",
"data": {
"_id": "6710c3d4e5f6a7b8c9d0e1f2",
"orderTypeId": "6710a2f4c1d2e3f4a5b6c7d8",
"orderTypeName": "Express Delivery",
"orderTypeVersion": 2,
"orderRefNumber": "EXP-0001",
"externalRef": "SO-2026-1001",
"hubId": "64d9932e2beb9037735ff022",
"hubName": "Jakarta Hub",
"status": "onDelivery",
"statusLabel": "On delivery",
"statusCategory": "inProgress",
"isFinal": false,
"values": {
"orderNo": "EXP-0001",
"customerName": "Rina",
"weight": 3
},
"createdFrom": "API",
"sourceTaskId": null,
"attention": null,
"activeSteps": [
{
"stepId": "pickup",
"title": "Pickup",
"type": "string",
"state": "waitingTask",
"since": "2026-10-16T02:01:00.000+00:00",
"taskIds": [
"6710d1e2f3a4b5c6d7e8f901"
]
}
],
"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"
},
"warnings": [
{
"code": "ord-093",
"params": {
"taskId": "6710d1e2f3a4b5c6d7e8f901",
"stepId": "pickup",
"fields": [
"values.weight"
]
}
}
]
}{
"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]."
}Update order
Updates the values of an order. Requires permission edit/order.
Only values, externalRef, hubId and expectedUpdatedTime are accepted; any other key is refused. Values are merged (send only the fields you change). The hub cannot change (sending the current one is allowed). Changing the first field changes the order number, which must stay unique.
Pass expectedUpdatedTime to refuse the update with 409 if the order changed since you read it. Final orders cannot be edited. Open tasks that use a changed value are listed in warnings (ord-093).
curl --request PUT \
--url https://apiweb.mile.app/api/v4/order/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"values": {
"weight": 3
},
"expectedUpdatedTime": "2026-10-16T02:01:00.000+00:00"
}
'import requests
url = "https://apiweb.mile.app/api/v4/order/{id}"
payload = {
"values": { "weight": 3 },
"expectedUpdatedTime": "2026-10-16T02:01:00.000+00:00"
}
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({values: {weight: 3}, expectedUpdatedTime: '2026-10-16T02:01:00.000+00:00'})
};
fetch('https://apiweb.mile.app/api/v4/order/{id}', 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}",
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([
'values' => [
'weight' => 3
],
'expectedUpdatedTime' => '2026-10-16T02:01:00.000+00:00'
]),
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}"
payload := strings.NewReader("{\n \"values\": {\n \"weight\": 3\n },\n \"expectedUpdatedTime\": \"2026-10-16T02:01:00.000+00:00\"\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}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"values\": {\n \"weight\": 3\n },\n \"expectedUpdatedTime\": \"2026-10-16T02:01:00.000+00:00\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/order/{id}")
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 \"values\": {\n \"weight\": 3\n },\n \"expectedUpdatedTime\": \"2026-10-16T02:01:00.000+00:00\"\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Order updated",
"data": {
"_id": "6710c3d4e5f6a7b8c9d0e1f2",
"orderTypeId": "6710a2f4c1d2e3f4a5b6c7d8",
"orderTypeName": "Express Delivery",
"orderTypeVersion": 2,
"orderRefNumber": "EXP-0001",
"externalRef": "SO-2026-1001",
"hubId": "64d9932e2beb9037735ff022",
"hubName": "Jakarta Hub",
"status": "onDelivery",
"statusLabel": "On delivery",
"statusCategory": "inProgress",
"isFinal": false,
"values": {
"orderNo": "EXP-0001",
"customerName": "Rina",
"weight": 3
},
"createdFrom": "API",
"sourceTaskId": null,
"attention": null,
"activeSteps": [
{
"stepId": "pickup",
"title": "Pickup",
"type": "string",
"state": "waitingTask",
"since": "2026-10-16T02:01:00.000+00:00",
"taskIds": [
"6710d1e2f3a4b5c6d7e8f901"
]
}
],
"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"
},
"warnings": [
{
"code": "ord-093",
"params": {
"taskId": "6710d1e2f3a4b5c6d7e8f901",
"stepId": "pickup",
"fields": [
"values.weight"
]
}
}
]
}{
"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
Values to change, keyed by field id of the latest published version; merged into the current values. Same formats as Create order.
Your own reference. Max 200 characters.
Must equal the current hub; the hub of an order cannot change.
The updatedTime you read. When given and the order changed since, the update is refused with 409.