Cancel an order
curl --request POST \
--url https://api.cubbo.com/v1/orders/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"store_id": 1234,
"order_number": "ORD-0001"
}
'import requests
url = "https://api.cubbo.com/v1/orders/cancel"
payload = {
"store_id": 1234,
"order_number": "ORD-0001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({store_id: 1234, order_number: 'ORD-0001'})
};
fetch('https://api.cubbo.com/v1/orders/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://api.cubbo.com/v1/orders/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'store_id' => 1234,
'order_number' => 'ORD-0001'
]),
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://api.cubbo.com/v1/orders/cancel"
payload := strings.NewReader("{\n \"store_id\": 1234,\n \"order_number\": \"ORD-0001\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.cubbo.com/v1/orders/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"store_id\": 1234,\n \"order_number\": \"ORD-0001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cubbo.com/v1/orders/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"store_id\": 1234,\n \"order_number\": \"ORD-0001\"\n}"
response = http.request(request)
puts response.read_body{}Orders
Cancel an order
Cancels one order, identified by its order_number within your store, and releases the stock
reserved for it. The cancellation is recorded in the order history with the reason
“Canceled from API”; it is not propagated to the sales channel the order came from.
- An order can be canceled while it is in
initial,unpaid,empty,error,cancelation_window,awaiting_fulfillment_request,entirely_dropshipping,backorder,hold,pending,processing,pickingorpacking(on pick-and-ship stores, only before the package is picked up). Ashippedorder can still be canceled while the carrier has not collected it (no dispatch yet and shipping status stillcreated,awaiting_collectionor undefined), unless it ships on an external label. - Canceling an order that is already
canceledorinterruptedis a no-op and returns200. - Orders already on their way or returned (
returning,returned,return_arrived,reentered, orshippedand dispatched) are refused with422. Those messages are returned in Spanish, exactly as shown in the examples. - Soft cancel: if Cubbo support has enabled “soft cancel on shipped orders” for your store, a
cancellation request for an order past the point of cancellation is answered with
200and{"status": "accepted", "order_id": ...}instead of422. The order is NOT canceled and keeps its status; the attempt is recorded in the order history so your team can act on it (for example, intercept the shipment or process a return). - Requires an API user with the “orders update” permission and access to the store;
otherwise
401. - Caution: some failures are answered with HTTP
200and anerrorbody (see the200examples). Always check for anerrorkey in the response, not only the status code.
POST
/
orders
/
cancel
Cancel an order
curl --request POST \
--url https://api.cubbo.com/v1/orders/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"store_id": 1234,
"order_number": "ORD-0001"
}
'import requests
url = "https://api.cubbo.com/v1/orders/cancel"
payload = {
"store_id": 1234,
"order_number": "ORD-0001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({store_id: 1234, order_number: 'ORD-0001'})
};
fetch('https://api.cubbo.com/v1/orders/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://api.cubbo.com/v1/orders/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'store_id' => 1234,
'order_number' => 'ORD-0001'
]),
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://api.cubbo.com/v1/orders/cancel"
payload := strings.NewReader("{\n \"store_id\": 1234,\n \"order_number\": \"ORD-0001\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.cubbo.com/v1/orders/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"store_id\": 1234,\n \"order_number\": \"ORD-0001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cubbo.com/v1/orders/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"store_id\": 1234,\n \"order_number\": \"ORD-0001\"\n}"
response = http.request(request)
puts response.read_body{}Authorizations
Body
application/json
Response
The order was canceled (empty object), the cancellation was accepted as a soft cancel, or
the request failed in a way that is reported with an error body.
- Option 1
- Option 2
- Option 3
Empty object returned when the cancellation or deletion succeeded.