Cancel order
curl --request PATCH \
--url https://staging-v2.sparqle.tech/orders/cancel/{orderId} \
--header 'api-key: <api-key>'import requests
url = "https://staging-v2.sparqle.tech/orders/cancel/{orderId}"
headers = {"api-key": "<api-key>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {'api-key': '<api-key>'}};
fetch('https://staging-v2.sparqle.tech/orders/cancel/{orderId}', 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://staging-v2.sparqle.tech/orders/cancel/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging-v2.sparqle.tech/orders/cancel/{orderId}"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://staging-v2.sparqle.tech/orders/cancel/{orderId}")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-v2.sparqle.tech/orders/cancel/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 1,
"orderId": "SPQ-10293",
"orderRef": "PADE3JWEA",
"status": "draft",
"name": "iPod",
"barcode": "3STBXX123456789",
"pudoId": "9f83c1b0a4",
"trackingUrl": "https://tracking.sparqle.com/barcode/3STBXX123456789",
"deliveryName": "Jane Doe",
"deliveryEmail": "[email protected]",
"deliveryAddress": "Gustav Mahlerlaan 320, 1082 ME Amsterdam",
"deliveryEta": "12:40 - 13:00",
"deliveryEtaDate": "2026-08-13",
"deliveryDate": "2026-08-13",
"locationId": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Cancellation
Cancel order
Cancel an order. Allowed up to and including the in_transit status.
PATCH
/
orders
/
cancel
/
{orderId}
Cancel order
curl --request PATCH \
--url https://staging-v2.sparqle.tech/orders/cancel/{orderId} \
--header 'api-key: <api-key>'import requests
url = "https://staging-v2.sparqle.tech/orders/cancel/{orderId}"
headers = {"api-key": "<api-key>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {'api-key': '<api-key>'}};
fetch('https://staging-v2.sparqle.tech/orders/cancel/{orderId}', 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://staging-v2.sparqle.tech/orders/cancel/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging-v2.sparqle.tech/orders/cancel/{orderId}"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://staging-v2.sparqle.tech/orders/cancel/{orderId}")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-v2.sparqle.tech/orders/cancel/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 1,
"orderId": "SPQ-10293",
"orderRef": "PADE3JWEA",
"status": "draft",
"name": "iPod",
"barcode": "3STBXX123456789",
"pudoId": "9f83c1b0a4",
"trackingUrl": "https://tracking.sparqle.com/barcode/3STBXX123456789",
"deliveryName": "Jane Doe",
"deliveryEmail": "[email protected]",
"deliveryAddress": "Gustav Mahlerlaan 320, 1082 ME Amsterdam",
"deliveryEta": "12:40 - 13:00",
"deliveryEtaDate": "2026-08-13",
"deliveryDate": "2026-08-13",
"locationId": 1,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
Path Parameters
Response
Order cancelled
Example:
1
Example:
"SPQ-10293"
Example:
"PADE3JWEA"
Available options:
draft, expected, in_transit, out_for_delivery, awaiting_next_attempt, at_pickup_point, completed, failed, in_return_transit, returned, cancelled, rejected, address_not_found, inactive, missing, lost, error Example:
"draft"
Example:
"iPod"
Example:
"3STBXX123456789"
Pickup point this order is delivered to, when there is one.
Example:
"9f83c1b0a4"
Example:
"https://tracking.sparqle.com/barcode/3STBXX123456789"
Example:
"Jane Doe"
Example:
Example:
"Gustav Mahlerlaan 320, 1082 ME Amsterdam"
Example:
"12:40 - 13:00"
Example:
"2026-08-13"
Example:
"2026-08-13"
Example:
1