Create a zone
curl --request POST \
--url https://app.papelship.com/api/v1/shipping/zones \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-store-hash: <api-key>' \
--data '
{
"name": "<string>",
"countries": [
"<string>"
],
"regions": {},
"active": true,
"rates": [
{
"id": 123,
"name": "Standard",
"description": "<string>",
"carrier_code": "dhl_express",
"price_cents": 500,
"tiers": [
{
"min": 123,
"max": 123,
"price_cents": 123
}
],
"volumetric_divisor": 123,
"free_over_cents": 123,
"min_days": 123,
"max_days": 123,
"active": true
}
]
}
'const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-store-hash': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
countries: ['<string>'],
regions: {},
active: true,
rates: [
{
id: 123,
name: 'Standard',
description: '<string>',
carrier_code: 'dhl_express',
price_cents: 500,
tiers: [{min: 123, max: 123, price_cents: 123}],
volumetric_divisor: 123,
free_over_cents: 123,
min_days: 123,
max_days: 123,
active: true
}
]
})
};
fetch('https://app.papelship.com/api/v1/shipping/zones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.papelship.com/api/v1/shipping/zones"
payload = {
"name": "<string>",
"countries": ["<string>"],
"regions": {},
"active": True,
"rates": [
{
"id": 123,
"name": "Standard",
"description": "<string>",
"carrier_code": "dhl_express",
"price_cents": 500,
"tiers": [
{
"min": 123,
"max": 123,
"price_cents": 123
}
],
"volumetric_divisor": 123,
"free_over_cents": 123,
"min_days": 123,
"max_days": 123,
"active": True
}
]
}
headers = {
"x-api-key": "<api-key>",
"x-store-hash": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.papelship.com/api/v1/shipping/zones",
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' => [
'<string>'
],
'regions' => [
],
'active' => true,
'rates' => [
[
'id' => 123,
'name' => 'Standard',
'description' => '<string>',
'carrier_code' => 'dhl_express',
'price_cents' => 500,
'tiers' => [
[
'min' => 123,
'max' => 123,
'price_cents' => 123
]
],
'volumetric_divisor' => 123,
'free_over_cents' => 123,
'min_days' => 123,
'max_days' => 123,
'active' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-store-hash: <api-key>"
],
]);
$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://app.papelship.com/api/v1/shipping/zones"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"countries\": [\n \"<string>\"\n ],\n \"regions\": {},\n \"active\": true,\n \"rates\": [\n {\n \"id\": 123,\n \"name\": \"Standard\",\n \"description\": \"<string>\",\n \"carrier_code\": \"dhl_express\",\n \"price_cents\": 500,\n \"tiers\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"price_cents\": 123\n }\n ],\n \"volumetric_divisor\": 123,\n \"free_over_cents\": 123,\n \"min_days\": 123,\n \"max_days\": 123,\n \"active\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-store-hash", "<api-key>")
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))
}{
"success": true,
"zone": {
"id": 123,
"name": "Europe",
"countries": [
"DE",
"FR"
],
"regions": {},
"active": true,
"position": 123,
"rates": [
{
"id": 123,
"name": "Standard",
"description": "<string>",
"carrier_code": "dhl_express",
"calc_type": "flat",
"price_cents": 500,
"tiers": [
{
"min": 123,
"max": 123,
"price_cents": 123
}
],
"volumetric_divisor": 123,
"free_over_cents": 123,
"min_days": 123,
"max_days": 123,
"active": true
}
]
}
}{
"success": false,
"code": "INVALID_REQUEST",
"error": "Request body must be valid JSON",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "INVALID_API_KEY",
"error": "Invalid API Key",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "INSUFFICIENT_SCOPE",
"error": "This API key needs the orders:write permission",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "VALIDATION_FAILED",
"error": "customer_email must be a valid email address",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "RATE_LIMITED",
"error": "Too many requests. The limit is 300 requests per minute per key.",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}Shipping settings
Create a zone
Needs the physical goods feature. VALIDATION_FAILED returns details.fields, for example {"rates.0.name": "required"}.
Permission: fulfillment:write
POST
/
shipping
/
zones
Create a zone
curl --request POST \
--url https://app.papelship.com/api/v1/shipping/zones \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-store-hash: <api-key>' \
--data '
{
"name": "<string>",
"countries": [
"<string>"
],
"regions": {},
"active": true,
"rates": [
{
"id": 123,
"name": "Standard",
"description": "<string>",
"carrier_code": "dhl_express",
"price_cents": 500,
"tiers": [
{
"min": 123,
"max": 123,
"price_cents": 123
}
],
"volumetric_divisor": 123,
"free_over_cents": 123,
"min_days": 123,
"max_days": 123,
"active": true
}
]
}
'const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-store-hash': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
countries: ['<string>'],
regions: {},
active: true,
rates: [
{
id: 123,
name: 'Standard',
description: '<string>',
carrier_code: 'dhl_express',
price_cents: 500,
tiers: [{min: 123, max: 123, price_cents: 123}],
volumetric_divisor: 123,
free_over_cents: 123,
min_days: 123,
max_days: 123,
active: true
}
]
})
};
fetch('https://app.papelship.com/api/v1/shipping/zones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.papelship.com/api/v1/shipping/zones"
payload = {
"name": "<string>",
"countries": ["<string>"],
"regions": {},
"active": True,
"rates": [
{
"id": 123,
"name": "Standard",
"description": "<string>",
"carrier_code": "dhl_express",
"price_cents": 500,
"tiers": [
{
"min": 123,
"max": 123,
"price_cents": 123
}
],
"volumetric_divisor": 123,
"free_over_cents": 123,
"min_days": 123,
"max_days": 123,
"active": True
}
]
}
headers = {
"x-api-key": "<api-key>",
"x-store-hash": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.papelship.com/api/v1/shipping/zones",
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' => [
'<string>'
],
'regions' => [
],
'active' => true,
'rates' => [
[
'id' => 123,
'name' => 'Standard',
'description' => '<string>',
'carrier_code' => 'dhl_express',
'price_cents' => 500,
'tiers' => [
[
'min' => 123,
'max' => 123,
'price_cents' => 123
]
],
'volumetric_divisor' => 123,
'free_over_cents' => 123,
'min_days' => 123,
'max_days' => 123,
'active' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-store-hash: <api-key>"
],
]);
$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://app.papelship.com/api/v1/shipping/zones"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"countries\": [\n \"<string>\"\n ],\n \"regions\": {},\n \"active\": true,\n \"rates\": [\n {\n \"id\": 123,\n \"name\": \"Standard\",\n \"description\": \"<string>\",\n \"carrier_code\": \"dhl_express\",\n \"price_cents\": 500,\n \"tiers\": [\n {\n \"min\": 123,\n \"max\": 123,\n \"price_cents\": 123\n }\n ],\n \"volumetric_divisor\": 123,\n \"free_over_cents\": 123,\n \"min_days\": 123,\n \"max_days\": 123,\n \"active\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-store-hash", "<api-key>")
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))
}{
"success": true,
"zone": {
"id": 123,
"name": "Europe",
"countries": [
"DE",
"FR"
],
"regions": {},
"active": true,
"position": 123,
"rates": [
{
"id": 123,
"name": "Standard",
"description": "<string>",
"carrier_code": "dhl_express",
"calc_type": "flat",
"price_cents": 500,
"tiers": [
{
"min": 123,
"max": 123,
"price_cents": 123
}
],
"volumetric_divisor": 123,
"free_over_cents": 123,
"min_days": 123,
"max_days": 123,
"active": true
}
]
}
}{
"success": false,
"code": "INVALID_REQUEST",
"error": "Request body must be valid JSON",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "INVALID_API_KEY",
"error": "Invalid API Key",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "INSUFFICIENT_SCOPE",
"error": "This API key needs the orders:write permission",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "VALIDATION_FAILED",
"error": "customer_email must be a valid email address",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}{
"success": false,
"code": "RATE_LIMITED",
"error": "Too many requests. The limit is 300 requests per minute per key.",
"request_id": "req_7YbK2mQ9xP1cRt4v"
}Yetkilendirmeler
Your Store API key (pk_live_...). Create it in Developers › API keys.
The ID of the store the request is for. Shown in Developers › API keys.
Başlıklar
Unique key (for example a UUID) that makes retries safe. The first response is stored for 24 hours and replayed for retries with the same key and body.
Maximum string length:
255Gövde
application/json