Update
curl --request PATCH \
--url https://{defaultHost}/v1/shipping_zones/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipping_zone": {
"name": "USA"
}
}
'import requests
url = "https://{defaultHost}/v1/shipping_zones/{id}"
payload = { "shipping_zone": { "name": "USA" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shipping_zone: {name: 'USA'}})
};
fetch('https://{defaultHost}/v1/shipping_zones/{id}', 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/shipping_zones/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'shipping_zone' => [
'name' => 'USA'
]
]),
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://{defaultHost}/v1/shipping_zones/{id}"
payload := strings.NewReader("{\n \"shipping_zone\": {\n \"name\": \"USA\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{defaultHost}/v1/shipping_zones/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipping_zone\": {\n \"name\": \"USA\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/shipping_zones/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipping_zone\": {\n \"name\": \"USA\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "e9dd929d-2de6-478e-872b-cf407b7845b9",
"object": "shipping_zone",
"name": "USA",
"territories": [
{
"country": "US",
"states": [
"NY",
"CA"
]
}
],
"postal_codes": [],
"shipping_profile": "1464fb4e-a60a-42ee-be08-c8720907a010",
"created_at": 1793797002,
"updated_at": 1793797002
}Shipping Zones
Update
Updates a specific shipping zone.
PATCH
/
v1
/
shipping_zones
/
{id}
Update
curl --request PATCH \
--url https://{defaultHost}/v1/shipping_zones/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipping_zone": {
"name": "USA"
}
}
'import requests
url = "https://{defaultHost}/v1/shipping_zones/{id}"
payload = { "shipping_zone": { "name": "USA" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({shipping_zone: {name: 'USA'}})
};
fetch('https://{defaultHost}/v1/shipping_zones/{id}', 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/shipping_zones/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'shipping_zone' => [
'name' => 'USA'
]
]),
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://{defaultHost}/v1/shipping_zones/{id}"
payload := strings.NewReader("{\n \"shipping_zone\": {\n \"name\": \"USA\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{defaultHost}/v1/shipping_zones/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipping_zone\": {\n \"name\": \"USA\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/shipping_zones/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"shipping_zone\": {\n \"name\": \"USA\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "e9dd929d-2de6-478e-872b-cf407b7845b9",
"object": "shipping_zone",
"name": "USA",
"territories": [
{
"country": "US",
"states": [
"NY",
"CA"
]
}
],
"postal_codes": [],
"shipping_profile": "1464fb4e-a60a-42ee-be08-c8720907a010",
"created_at": 1793797002,
"updated_at": 1793797002
}Authorizations
Response
200 - application/json
Success
Optional array of postal code patterns to further filter addresses within the specified territories. Postal code filtering is applied in addition to territory filtering - an address must match both a territory and a postal code pattern (if provided) to be included in this shipping zone. Supports three matching modes:
- Exact match: Provide the complete postal code as a string (e.g., "90210", "SW1A 1AA").
- Range match: Use three dots ("...") to specify a numeric range (e.g., "90210...99000" matches all postal codes from 90210 to 99000). Only numeric postal codes are supported for ranges.
- Wildcard match: Use asterisk ("") for prefix matching (e.g., "902" matches "90210", "90211", "902AB", etc.). All postal codes are normalized (uppercased and trimmed) before matching. If the array is empty, no postal code filtering is applied and all addresses within the territories will match.
Expandable – The associated shipping profile ID.
Expandable – Property not returned unless expanded.
Was this page helpful?