Cancel a parcel
curl --request POST \
--url https://panel.sendcloud.sc/api/v2/parcels/{id}/cancel \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://panel.sendcloud.sc/api/v2/parcels/{id}/cancel"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://panel.sendcloud.sc/api/v2/parcels/{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://panel.sendcloud.sc/api/v2/parcels/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://panel.sendcloud.sc/api/v2/parcels/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://panel.sendcloud.sc/api/v2/parcels/{id}/cancel")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v2/parcels/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"status": "cancelled",
"message": "Parcel has been cancelled"
}Parcels API
Cancel a parcel
Cancel an announced parcel (if supported by the carrier) or delete an unannounced parcel.
POST
/
parcels
/
{id}
/
cancel
Cancel a parcel
curl --request POST \
--url https://panel.sendcloud.sc/api/v2/parcels/{id}/cancel \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://panel.sendcloud.sc/api/v2/parcels/{id}/cancel"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://panel.sendcloud.sc/api/v2/parcels/{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://panel.sendcloud.sc/api/v2/parcels/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://panel.sendcloud.sc/api/v2/parcels/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://panel.sendcloud.sc/api/v2/parcels/{id}/cancel")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://panel.sendcloud.sc/api/v2/parcels/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"status": "cancelled",
"message": "Parcel has been cancelled"
}API v2 is entering maintenance mode. New users should start with API v3 to access our latest features and improved performance. Already using v2? Don’t worry, your current integration remains fully functional. Read more about maintenance mode, or check out the migration guide for API v3.
- Cancel an announced parcel; or,
- Delete an unannounced parcel
Cancelling a parcel
When you cancel a parcel which has already been announced (has a shipping label attached to it), you will still be able to find it via theparcel_id and the Retrieve a parcel endpoint. In the Sendcloud platform, it will appear in your Cancelled labels overview.
Insurance Notice: If you proceed to ship a parcel that was initially cancelled, the parcel’s insurance coverage will become void, and any insurance claims will not be valid for that shipment.
After 42 days, it’s no longer possible to cancel a parcel, even if it hasn’t been shipped.
Conditions for label cancellation
It’s not always possible to cancel a parcel which has already been announced. As a result, cancellation is not guaranteed and may be asynchronous depending on the state of the parcel. When you send a cancellation request via this endpoint, the response will indicate the status of the cancellation request.Each carrier has different cancellation deadlines. Some carriers do not accept cancellation requests regardless of whether or not the label is cancelled within the deadline. You can find more information about cancellation deadlines in our help center.
Deleting a parcel
When you delete a parcel which hasn’t been announced, the parcel will be removed from the Sendcloud system and you will no longer be able to locate it via the parcelid. You will need to create the parcel again if you want to announce it at a later date.Authorizations
HTTPBasicAuthOAuth2ClientCreds
Basic Authentication using API key and secrets is currently the main authentication mechanism.
Path Parameters
ID of the parcel