curl --request PATCH \
--url https://{defaultHost}/v1/shipments/{id}/void \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/shipments/{id}/void"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/shipments/{id}/void', 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://{defaultHost}/v1/shipments/{id}/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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://{defaultHost}/v1/shipments/{id}/void"
req, _ := http.NewRequest("PATCH", 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.patch("https://{defaultHost}/v1/shipments/{id}/void")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/shipments/{id}/void")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "fb0ff4b8-44ad-4765-b74e-6ff17e9e0699",
"object": "shipment",
"carrier": "USPS",
"carrier_messages": [],
"contact_validations": null,
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"customs_declaration": null,
"international": false,
"customs_required": false,
"eta": null,
"inherit_weight": false,
"label_file_type": "PDF",
"label_url": "https://deliver.goshippo.com/label.pdf",
"live_mode": true,
"rates": [
{
"id": "rate_1",
"amount": 550,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority",
"estimated_days": 3,
"tags": [
"bestvalue"
],
"duration_terms": null,
"provider_logo_url": "https://example.com/usps.png"
}
],
"selected_rate": {
"id": "rate_1",
"amount": 550,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority",
"estimated_days": 3,
"tags": [
"bestvalue"
],
"duration_terms": null,
"provider_logo_url": "https://example.com/usps.png"
},
"shipping_date": 1793750400,
"status": "voided",
"tracking_number": "1Z999AA10123456784",
"tracking_status": null,
"tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=1Z999AA10123456784",
"weight": "2.0",
"weight_unit": "lb",
"carrier_parcel_template_token": null,
"from_contact": "197a3111-9260-4c15-aa0a-a244604ffc1d",
"fulfillment": "ab3b63dd-9a1c-44d1-9535-994b796023d5",
"parcel_template": null,
"shipping_provider": "dc06c35a-f7af-4840-93ea-e0c28f6b4505",
"to_contact": "65a2f4f0-fd4b-4e0f-9cc6-9ecd322908b1",
"created_at": 1793796996,
"updated_at": 1793796996
}Void
Voids a purchased shipping label for a specific shipment.
curl --request PATCH \
--url https://{defaultHost}/v1/shipments/{id}/void \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/shipments/{id}/void"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/shipments/{id}/void', 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://{defaultHost}/v1/shipments/{id}/void",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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://{defaultHost}/v1/shipments/{id}/void"
req, _ := http.NewRequest("PATCH", 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.patch("https://{defaultHost}/v1/shipments/{id}/void")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/shipments/{id}/void")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "fb0ff4b8-44ad-4765-b74e-6ff17e9e0699",
"object": "shipment",
"carrier": "USPS",
"carrier_messages": [],
"contact_validations": null,
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"customs_declaration": null,
"international": false,
"customs_required": false,
"eta": null,
"inherit_weight": false,
"label_file_type": "PDF",
"label_url": "https://deliver.goshippo.com/label.pdf",
"live_mode": true,
"rates": [
{
"id": "rate_1",
"amount": 550,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority",
"estimated_days": 3,
"tags": [
"bestvalue"
],
"duration_terms": null,
"provider_logo_url": "https://example.com/usps.png"
}
],
"selected_rate": {
"id": "rate_1",
"amount": 550,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority",
"estimated_days": 3,
"tags": [
"bestvalue"
],
"duration_terms": null,
"provider_logo_url": "https://example.com/usps.png"
},
"shipping_date": 1793750400,
"status": "voided",
"tracking_number": "1Z999AA10123456784",
"tracking_status": null,
"tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=1Z999AA10123456784",
"weight": "2.0",
"weight_unit": "lb",
"carrier_parcel_template_token": null,
"from_contact": "197a3111-9260-4c15-aa0a-a244604ffc1d",
"fulfillment": "ab3b63dd-9a1c-44d1-9535-994b796023d5",
"parcel_template": null,
"shipping_provider": "dc06c35a-f7af-4840-93ea-e0c28f6b4505",
"to_contact": "65a2f4f0-fd4b-4e0f-9cc6-9ecd322908b1",
"created_at": 1793796996,
"updated_at": 1793796996
}Authorizations
Response
Success
Expandable – The associated parcel template ID.
The token of a carrier parcel template (e.g. USPS_SmallFlatRateBox), resolved against this shipment's own shipping provider. Defaults to the parcel template's token when parcel_template is set, and can be cleared or overridden by passing it explicitly. When it resolves to a fixed-size package its dimensions are used, and quoted rates cover only that carrier — read the carrier itself from the parcel template, or from the selected rate once one is chosen. Cannot be changed after the label is purchased.
Expandable – The associated fulfillment ID.
Expandable – The associated shipping provider ID.
Expandable – The associated contact ID.
Expandable – The associated contact ID.
Was this page helpful?