Create Shipping Zone
curl --request POST \
--url https://api.launchmystore.io/api/v1/shipping_zones.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"countries": [
{}
],
"description": "<string>",
"price": 123,
"type": "<string>",
"digitalProd": true,
"minWeight": 123,
"maxWeight": 123,
"minPrice": 123,
"maxPrice": 123
}
'import requests
url = "https://api.launchmystore.io/api/v1/shipping_zones.json"
payload = {
"name": "<string>",
"countries": [{}],
"description": "<string>",
"price": 123,
"type": "<string>",
"digitalProd": True,
"minWeight": 123,
"maxWeight": 123,
"minPrice": 123,
"maxPrice": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
countries: [{}],
description: '<string>',
price: 123,
type: '<string>',
digitalProd: true,
minWeight: 123,
maxWeight: 123,
minPrice: 123,
maxPrice: 123
})
};
fetch('https://api.launchmystore.io/api/v1/shipping_zones.json', 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.launchmystore.io/api/v1/shipping_zones.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'countries' => [
[
]
],
'description' => '<string>',
'price' => 123,
'type' => '<string>',
'digitalProd' => true,
'minWeight' => 123,
'maxWeight' => 123,
'minPrice' => 123,
'maxPrice' => 123
]),
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://api.launchmystore.io/api/v1/shipping_zones.json"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"countries\": [\n {}\n ],\n \"description\": \"<string>\",\n \"price\": 123,\n \"type\": \"<string>\",\n \"digitalProd\": true,\n \"minWeight\": 123,\n \"maxWeight\": 123,\n \"minPrice\": 123,\n \"maxPrice\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.launchmystore.io/api/v1/shipping_zones.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"countries\": [\n {}\n ],\n \"description\": \"<string>\",\n \"price\": 123,\n \"type\": \"<string>\",\n \"digitalProd\": true,\n \"minWeight\": 123,\n \"maxWeight\": 123,\n \"minPrice\": 123,\n \"maxPrice\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/shipping_zones.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"countries\": [\n {}\n ],\n \"description\": \"<string>\",\n \"price\": 123,\n \"type\": \"<string>\",\n \"digitalProd\": true,\n \"minWeight\": 123,\n \"maxWeight\": 123,\n \"minPrice\": 123,\n \"maxPrice\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"state": "success",
"message": null,
"data": {
"shipping_zone": {
"shippingZoneId": "f3b9c1a2-7d44-4e2b-9a10-5c8e6f2d1b3a",
"shippingName": "Asia Pacific",
"zone": ["JP", "KR", "SG", "AU", "NZ"],
"description": "Standard international delivery",
"price": "19.99",
"type": "Simple",
"digitalProd": true,
"minWeight": null,
"maxWeight": null,
"minPrice": null,
"maxPrice": null,
"storeId": "2a7c9e10-1f3b-4d62-8a51-9b0c7e4f2d8a",
"createdAt": "2024-01-20T14:30:00Z",
"updatedAt": "2024-01-20T14:30:00Z"
}
},
"count": null,
"pagination": null
}
Shipping Zones
Create Shipping Zone
Create a new shipping zone
POST
/
api
/
v1
/
shipping_zones.json
Create Shipping Zone
curl --request POST \
--url https://api.launchmystore.io/api/v1/shipping_zones.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"countries": [
{}
],
"description": "<string>",
"price": 123,
"type": "<string>",
"digitalProd": true,
"minWeight": 123,
"maxWeight": 123,
"minPrice": 123,
"maxPrice": 123
}
'import requests
url = "https://api.launchmystore.io/api/v1/shipping_zones.json"
payload = {
"name": "<string>",
"countries": [{}],
"description": "<string>",
"price": 123,
"type": "<string>",
"digitalProd": True,
"minWeight": 123,
"maxWeight": 123,
"minPrice": 123,
"maxPrice": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
countries: [{}],
description: '<string>',
price: 123,
type: '<string>',
digitalProd: true,
minWeight: 123,
maxWeight: 123,
minPrice: 123,
maxPrice: 123
})
};
fetch('https://api.launchmystore.io/api/v1/shipping_zones.json', 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.launchmystore.io/api/v1/shipping_zones.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'countries' => [
[
]
],
'description' => '<string>',
'price' => 123,
'type' => '<string>',
'digitalProd' => true,
'minWeight' => 123,
'maxWeight' => 123,
'minPrice' => 123,
'maxPrice' => 123
]),
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://api.launchmystore.io/api/v1/shipping_zones.json"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"countries\": [\n {}\n ],\n \"description\": \"<string>\",\n \"price\": 123,\n \"type\": \"<string>\",\n \"digitalProd\": true,\n \"minWeight\": 123,\n \"maxWeight\": 123,\n \"minPrice\": 123,\n \"maxPrice\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.launchmystore.io/api/v1/shipping_zones.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"countries\": [\n {}\n ],\n \"description\": \"<string>\",\n \"price\": 123,\n \"type\": \"<string>\",\n \"digitalProd\": true,\n \"minWeight\": 123,\n \"maxWeight\": 123,\n \"minPrice\": 123,\n \"maxPrice\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/shipping_zones.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"countries\": [\n {}\n ],\n \"description\": \"<string>\",\n \"price\": 123,\n \"type\": \"<string>\",\n \"digitalProd\": true,\n \"minWeight\": 123,\n \"maxWeight\": 123,\n \"minPrice\": 123,\n \"maxPrice\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"state": "success",
"message": null,
"data": {
"shipping_zone": {
"shippingZoneId": "f3b9c1a2-7d44-4e2b-9a10-5c8e6f2d1b3a",
"shippingName": "Asia Pacific",
"zone": ["JP", "KR", "SG", "AU", "NZ"],
"description": "Standard international delivery",
"price": "19.99",
"type": "Simple",
"digitalProd": true,
"minWeight": null,
"maxWeight": null,
"minPrice": null,
"maxPrice": null,
"storeId": "2a7c9e10-1f3b-4d62-8a51-9b0c7e4f2d8a",
"createdAt": "2024-01-20T14:30:00Z",
"updatedAt": "2024-01-20T14:30:00Z"
}
},
"count": null,
"pagination": null
}
Body Parameters
A shipping zone has a single flat shipping price plus optional weight- or price-based thresholds. There is no per-zone collection of named rates.Zone name (e.g., “Domestic”, “Europe”, “Rest of World”). Stored as
shippingName. You may send shippingName directly instead of name.Array of ISO 3166-1 alpha-2 country codes for this zone. Stored as
zone.
You may send zone (an array of country codes) directly instead.Optional zone description.
Flat shipping price for this zone.
Rate model:
Simple (flat price), Weight (weight-based thresholds), or
Price (order-total thresholds). Defaults to Simple.Whether the zone applies to digital products. Defaults to
true.Minimum order weight (used when
type is Weight).Maximum order weight (used when
type is Weight).Minimum order subtotal (used when
type is Price).Maximum order subtotal (used when
type is Price).Response
Returns the standard response envelope with the created zone underdata.shipping_zone.
{
"status": 201,
"state": "success",
"message": null,
"data": {
"shipping_zone": {
"shippingZoneId": "f3b9c1a2-7d44-4e2b-9a10-5c8e6f2d1b3a",
"shippingName": "Asia Pacific",
"zone": ["JP", "KR", "SG", "AU", "NZ"],
"description": "Standard international delivery",
"price": "19.99",
"type": "Simple",
"digitalProd": true,
"minWeight": null,
"maxWeight": null,
"minPrice": null,
"maxPrice": null,
"storeId": "2a7c9e10-1f3b-4d62-8a51-9b0c7e4f2d8a",
"createdAt": "2024-01-20T14:30:00Z",
"updatedAt": "2024-01-20T14:30:00Z"
}
},
"count": null,
"pagination": null
}
Error Response
{
"status": 400,
"state": "error",
"message": "Missing required field: shippingName",
"data": null
}
⌘I