curl -X POST "$RUN_BASE_URL/business/orders/6a7c75f801df3fbb7fad0c58/cancel" \
-H "Authorization: Bearer $RUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "reason": "Customer changed address" }'
const res = await fetch(
`${process.env.RUN_BASE_URL}/business/orders/6a7c75f801df3fbb7fad0c58/cancel`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RUN_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ reason: 'Customer changed address' }),
},
);
const result = await res.json();
import os
import requests
res = requests.post(
f"{os.environ['RUN_BASE_URL']}/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
headers={
"Authorization": f"Bearer {os.environ['RUN_API_KEY']}",
"Content-Type": "application/json",
},
json={"reason": "Customer changed address"},
)
result = res.json()
<?php
$ch = curl_init(getenv('RUN_BASE_URL') . '/business/orders/6a7c75f801df3fbb7fad0c58/cancel');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RUN_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Customer changed address',
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"reason":"Customer changed address"}`)
req, _ := http.NewRequest(
"POST",
os.Getenv("RUN_BASE_URL")+"/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
bytes.NewReader(body),
)
req.Header.Set("Authorization", "Bearer "+os.Getenv("RUN_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
{
"message": "Dispatch cancelled successfully",
"order_id": "RUN-A1B2C3D4",
"status": "CANCELLED",
"cancel": true
}
{
"statusCode": 400,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Order cannot be cancelled in its current status"
}
{
"statusCode": 401,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Invalid API key"
}
{
"statusCode": 403,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Insufficient API key scope"
}
{
"statusCode": 404,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Order not found"
}
Cancel order
Cancel an order and refund the cost to your Business wallet when it was wallet-paid.
POST
/
business
/
orders
/
:id
/
cancel
curl -X POST "$RUN_BASE_URL/business/orders/6a7c75f801df3fbb7fad0c58/cancel" \
-H "Authorization: Bearer $RUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "reason": "Customer changed address" }'
const res = await fetch(
`${process.env.RUN_BASE_URL}/business/orders/6a7c75f801df3fbb7fad0c58/cancel`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RUN_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ reason: 'Customer changed address' }),
},
);
const result = await res.json();
import os
import requests
res = requests.post(
f"{os.environ['RUN_BASE_URL']}/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
headers={
"Authorization": f"Bearer {os.environ['RUN_API_KEY']}",
"Content-Type": "application/json",
},
json={"reason": "Customer changed address"},
)
result = res.json()
<?php
$ch = curl_init(getenv('RUN_BASE_URL') . '/business/orders/6a7c75f801df3fbb7fad0c58/cancel');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RUN_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Customer changed address',
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"reason":"Customer changed address"}`)
req, _ := http.NewRequest(
"POST",
os.Getenv("RUN_BASE_URL")+"/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
bytes.NewReader(body),
)
req.Header.Set("Authorization", "Bearer "+os.Getenv("RUN_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
{
"message": "Dispatch cancelled successfully",
"order_id": "RUN-A1B2C3D4",
"status": "CANCELLED",
"cancel": true
}
{
"statusCode": 400,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Order cannot be cancelled in its current status"
}
{
"statusCode": 401,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Invalid API key"
}
{
"statusCode": 403,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Insufficient API key scope"
}
{
"statusCode": 404,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Order not found"
}
Cancels an order and, if it was paid from your Business wallet, refunds the cost to that wallet.
Requires scope:
See Shipment statuses for the full lifecycle.
orders:write
An order can only be cancelled while its
status is one of:PENDINGASSIGNEDACCEPTEDSTART_TRIP
HEADING_TO_PICKUP, PICKED_UP, HEADING_TO_DELIVERY, or DELIVERED) is rejected with 400.Only single-order cancellation is supported — there is no bulk cancel.Headers
string
required
Bearer API key (
Bearer <api_key>).string
application/json when sending a body.Path parameters
string
required
MongoDB document id of the order (not the
order_id display code). Same id as Get order.Body
string
Optional cancel reason (max 500 characters).
Response
string
Success message.
string
Human-readable order code.
string
Always
CANCELLED on success.boolean
Always
true on success.curl -X POST "$RUN_BASE_URL/business/orders/6a7c75f801df3fbb7fad0c58/cancel" \
-H "Authorization: Bearer $RUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "reason": "Customer changed address" }'
const res = await fetch(
`${process.env.RUN_BASE_URL}/business/orders/6a7c75f801df3fbb7fad0c58/cancel`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RUN_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ reason: 'Customer changed address' }),
},
);
const result = await res.json();
import os
import requests
res = requests.post(
f"{os.environ['RUN_BASE_URL']}/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
headers={
"Authorization": f"Bearer {os.environ['RUN_API_KEY']}",
"Content-Type": "application/json",
},
json={"reason": "Customer changed address"},
)
result = res.json()
<?php
$ch = curl_init(getenv('RUN_BASE_URL') . '/business/orders/6a7c75f801df3fbb7fad0c58/cancel');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RUN_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Customer changed address',
]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{"reason":"Customer changed address"}`)
req, _ := http.NewRequest(
"POST",
os.Getenv("RUN_BASE_URL")+"/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
bytes.NewReader(body),
)
req.Header.Set("Authorization", "Bearer "+os.Getenv("RUN_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}
{
"message": "Dispatch cancelled successfully",
"order_id": "RUN-A1B2C3D4",
"status": "CANCELLED",
"cancel": true
}
{
"statusCode": 400,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Order cannot be cancelled in its current status"
}
{
"statusCode": 401,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Invalid API key"
}
{
"statusCode": 403,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Insufficient API key scope"
}
{
"statusCode": 404,
"timestamp": "2026-08-12T15:18:51.396Z",
"path": "/api/v2/business/orders/6a7c75f801df3fbb7fad0c58/cancel",
"message": "Order not found"
}
⌘I