curl --request POST \
--url https://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/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.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/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: Bearer <token>"
],
]);
$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://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"currency": "DKK",
"weight_unit": "g",
"dimension_unit": "cm",
"invoice_number": null,
"reference": "ORDER-1042",
"identifier": "shop-order-1042",
"uri": null,
"delivery": {
"carrier": {
"code": "postnord",
"name": "PostNord",
"logo_url": null,
"icon_url": null
},
"last_mile_carrier": {
"code": "postnord",
"name": "PostNord",
"logo_url": null,
"icon_url": null
},
"service_code": "postnord_agent",
"service_name": "Service point",
"is_pickup": true,
"is_return": false,
"addons": [],
"pickup_point": {
"uuid": "99999999-9999-4999-8999-999999999999",
"carrier_code": "postnord",
"code": "12345",
"name": "Example Parcel Shop",
"address": {
"address_lines": [
"Eksempelvej 20"
],
"postal_code": "8000",
"city": "Aarhus C",
"country": "DK",
"administrative_area": null
}
},
"delivery_window": null,
"incoterm": null
},
"parties": {
"merchant": {
"reference": null,
"identifier": null,
"uri": null,
"address": {
"address_lines": [
"Eksempelgade 1"
],
"postal_code": "2100",
"city": "Copenhagen",
"country": "DK",
"administrative_area": null
},
"contact": {
"name_lines": [
"Example Shop"
],
"company": "Example Shop",
"email": "shop@example.com",
"phone": "+4587654321"
},
"identifiers": null
},
"customer": {
"reference": null,
"identifier": null,
"uri": null,
"address": {
"address_lines": [
"Eksempelvej 10"
],
"postal_code": "8000",
"city": "Aarhus C",
"country": "DK",
"administrative_area": null
},
"contact": {
"name_lines": [
"Example Customer"
],
"company": null,
"email": "customer@example.com",
"phone": "+4512345678"
},
"identifiers": null
}
},
"parcels": [
{
"reference": "ORDER-1042-1",
"identifier": "shop-parcel-1",
"freetext": null,
"gross_weight": 1500,
"length": 30,
"width": 20,
"height": 15,
"total_net_amount": null,
"tax_amount": null,
"duty_amount": null,
"items": [],
"uuid": "33333333-3333-4333-8333-333333333333",
"tracking_number": "00340434161094015749",
"tracking_url": "https://track.smartsend.io/example",
"tracking": {
"uuid": "66666666-6666-4666-8666-666666666666",
"tracking_number": "00340434161094015749",
"tracking_url": "https://track.smartsend.io/example",
"state": "InfoReceived",
"description": "Shipment information received.",
"estimated_delivery": null,
"delivered_at": null,
"returned_at": null,
"last_updated_at": "2026-09-16T10:00:02Z"
}
}
],
"total_net_amount": null,
"tax_amount": null,
"duty_amount": null,
"shipping_net_amount": null,
"shipping_tax_amount": null,
"content_type": null,
"uuid": "22222222-2222-4222-8222-222222222222",
"state": "cancelled",
"documents": [
{
"uuid": "44444444-4444-4444-8444-444444444444",
"name": "Shipping label",
"filename": "ORDER-1042-label.pdf",
"types": [
"label"
],
"format": "pdf",
"mime_type": "application/pdf",
"size_bytes": 18342,
"width": {
"value": 210,
"unit": "mm"
},
"height": {
"value": 297,
"unit": "mm"
},
"page_count": 1,
"url": "https://downloads.example.com/documents/label.pdf",
"url_expires_at": "2026-09-16T10:15:02Z",
"description": "Print and attach the label.",
"source": {
"type": "shipment",
"uuid": "22222222-2222-4222-8222-222222222222"
},
"print_status": null,
"created_at": "2026-09-16T10:00:02Z",
"updated_at": "2026-09-16T10:00:02Z"
}
],
"qr_codes": [],
"drop_off_codes": [],
"batch_uuid": null,
"error": null,
"created_at": "2026-09-16T10:00:00Z",
"updated_at": "2026-09-16T10:00:12Z",
"booked_at": "2026-09-16T10:00:02Z",
"cancelled_at": "2026-09-16T10:00:12Z",
"voided_at": null
}
}Cancel a booked shipment
Accept cancellation independently of whether the carrier supports external cancellation. Allowed once carrier acceptance is confirmed, including a failed document-generation workflow. Transition to cancelling, then cancelled if external cancellation is unsupported, rejected or unconfirmed, or voided if confirmed. Fast completion returns 200; after 10 seconds return 202 and poll Location. A later valid carrier confirmation may upgrade cancelled to voided. Internal cancellation success is 200 even if the carrier cannot cancel. Repeated requests for cancelling/cancelled/voided shipments return the current result without submitting another cancellation attempt. Never deletes the shipment or stops tracking. Other source states return 409.
curl --request POST \
--url https://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/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.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/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: Bearer <token>"
],
]);
$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://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartsend.io/v2/teams/{teamUuid}/shipments/{shipment}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"currency": "DKK",
"weight_unit": "g",
"dimension_unit": "cm",
"invoice_number": null,
"reference": "ORDER-1042",
"identifier": "shop-order-1042",
"uri": null,
"delivery": {
"carrier": {
"code": "postnord",
"name": "PostNord",
"logo_url": null,
"icon_url": null
},
"last_mile_carrier": {
"code": "postnord",
"name": "PostNord",
"logo_url": null,
"icon_url": null
},
"service_code": "postnord_agent",
"service_name": "Service point",
"is_pickup": true,
"is_return": false,
"addons": [],
"pickup_point": {
"uuid": "99999999-9999-4999-8999-999999999999",
"carrier_code": "postnord",
"code": "12345",
"name": "Example Parcel Shop",
"address": {
"address_lines": [
"Eksempelvej 20"
],
"postal_code": "8000",
"city": "Aarhus C",
"country": "DK",
"administrative_area": null
}
},
"delivery_window": null,
"incoterm": null
},
"parties": {
"merchant": {
"reference": null,
"identifier": null,
"uri": null,
"address": {
"address_lines": [
"Eksempelgade 1"
],
"postal_code": "2100",
"city": "Copenhagen",
"country": "DK",
"administrative_area": null
},
"contact": {
"name_lines": [
"Example Shop"
],
"company": "Example Shop",
"email": "shop@example.com",
"phone": "+4587654321"
},
"identifiers": null
},
"customer": {
"reference": null,
"identifier": null,
"uri": null,
"address": {
"address_lines": [
"Eksempelvej 10"
],
"postal_code": "8000",
"city": "Aarhus C",
"country": "DK",
"administrative_area": null
},
"contact": {
"name_lines": [
"Example Customer"
],
"company": null,
"email": "customer@example.com",
"phone": "+4512345678"
},
"identifiers": null
}
},
"parcels": [
{
"reference": "ORDER-1042-1",
"identifier": "shop-parcel-1",
"freetext": null,
"gross_weight": 1500,
"length": 30,
"width": 20,
"height": 15,
"total_net_amount": null,
"tax_amount": null,
"duty_amount": null,
"items": [],
"uuid": "33333333-3333-4333-8333-333333333333",
"tracking_number": "00340434161094015749",
"tracking_url": "https://track.smartsend.io/example",
"tracking": {
"uuid": "66666666-6666-4666-8666-666666666666",
"tracking_number": "00340434161094015749",
"tracking_url": "https://track.smartsend.io/example",
"state": "InfoReceived",
"description": "Shipment information received.",
"estimated_delivery": null,
"delivered_at": null,
"returned_at": null,
"last_updated_at": "2026-09-16T10:00:02Z"
}
}
],
"total_net_amount": null,
"tax_amount": null,
"duty_amount": null,
"shipping_net_amount": null,
"shipping_tax_amount": null,
"content_type": null,
"uuid": "22222222-2222-4222-8222-222222222222",
"state": "cancelled",
"documents": [
{
"uuid": "44444444-4444-4444-8444-444444444444",
"name": "Shipping label",
"filename": "ORDER-1042-label.pdf",
"types": [
"label"
],
"format": "pdf",
"mime_type": "application/pdf",
"size_bytes": 18342,
"width": {
"value": 210,
"unit": "mm"
},
"height": {
"value": 297,
"unit": "mm"
},
"page_count": 1,
"url": "https://downloads.example.com/documents/label.pdf",
"url_expires_at": "2026-09-16T10:15:02Z",
"description": "Print and attach the label.",
"source": {
"type": "shipment",
"uuid": "22222222-2222-4222-8222-222222222222"
},
"print_status": null,
"created_at": "2026-09-16T10:00:02Z",
"updated_at": "2026-09-16T10:00:02Z"
}
],
"qr_codes": [],
"drop_off_codes": [],
"batch_uuid": null,
"error": null,
"created_at": "2026-09-16T10:00:00Z",
"updated_at": "2026-09-16T10:00:12Z",
"booked_at": "2026-09-16T10:00:02Z",
"cancelled_at": "2026-09-16T10:00:12Z",
"voided_at": null
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Preferred language(s) for translatable content using BCP 47 language tags. Supports quality values (q-factors) for priority ordering. The API negotiates the best available language based on this header, the team's configured language, and available translations. If omitted, the team's default language is used.
"da-DK, da;q=0.9, en;q=0.8"
Optional client-supplied request identifier. When provided and matching the validation pattern, the value is echoed back in the Request-ID response header. Otherwise the server generates one. Use this to correlate requests between client and server when reporting issues.
1 - 64^[A-Za-z0-9._-]{1,64}$Optional, case-sensitive key for one intended action. Scope: team, HTTP method and canonical path. Retained for at least 24 hours and while processing. Same key and payload reuses the stored outcome without repeating side effects; the resource representation is current. Changed payload: 422 with an Idempotency-Key entry in errors. Concurrent duplicate: 409 with Retry-After and Location when known. Without a key there is no deduplication. Use GET at Location after 202.
16 - 128^[A-Za-z0-9._-]{16,128}$Path Parameters
Team uuid. All resources are scoped to this team.
UUID of the shipment in this team.
Response
Internal cancellation completed, with optional carrier confirmation.
Current immutable booking input plus evolving lifecycle and results. Each shipment has one logical booking. Full event and print histories are retrieved through their own paginated endpoints. A failed document workflow may still have a carrier booking; never blindly rebook such a result.
Show child attributes
Show child attributes
Was this page helpful?