Quote shipping
curl --request POST \
--url https://app.papelship.com/api/v1/shipping/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-store-hash: <api-key>' \
--data '
{
"destination": {
"country_code": "DE",
"region": "<string>",
"postal_code": "<string>"
},
"items": [
{
"quantity": 123,
"unit_price_cents": 123,
"weight_grams": 123,
"length_cm": 123,
"width_cm": 123,
"height_cm": 123
}
]
}
'const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-store-hash': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
destination: {country_code: 'DE', region: '<string>', postal_code: '<string>'},
items: [
{
quantity: 123,
unit_price_cents: 123,
weight_grams: 123,
length_cm: 123,
width_cm: 123,
height_cm: 123
}
]
})
};
fetch('https://app.papelship.com/api/v1/shipping/quote', 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/quote"
payload = {
"destination": {
"country_code": "DE",
"region": "<string>",
"postal_code": "<string>"
},
"items": [
{
"quantity": 123,
"unit_price_cents": 123,
"weight_grams": 123,
"length_cm": 123,
"width_cm": 123,
"height_cm": 123
}
]
}
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/quote",
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([
'destination' => [
'country_code' => 'DE',
'region' => '<string>',
'postal_code' => '<string>'
],
'items' => [
[
'quantity' => 123,
'unit_price_cents' => 123,
'weight_grams' => 123,
'length_cm' => 123,
'width_cm' => 123,
'height_cm' => 123
]
]
]),
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/quote"
payload := strings.NewReader("{\n \"destination\": {\n \"country_code\": \"DE\",\n \"region\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_price_cents\": 123,\n \"weight_grams\": 123,\n \"length_cm\": 123,\n \"width_cm\": 123,\n \"height_cm\": 123\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,
"currency": "<string>",
"zone": {
"id": 123,
"name": "<string>"
},
"rates": [
{
"rate_id": 123,
"zone_id": 123,
"name": "<string>",
"description": "<string>",
"carrier_code": "<string>",
"price_cents": 123,
"min_days": 123,
"max_days": 123,
"free": true
}
]
}{
"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
Quote shipping
Shipping options and prices for a destination and a basket. Read permission is enough.
Permission: fulfillment:read
POST
/
shipping
/
quote
Quote shipping
curl --request POST \
--url https://app.papelship.com/api/v1/shipping/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-store-hash: <api-key>' \
--data '
{
"destination": {
"country_code": "DE",
"region": "<string>",
"postal_code": "<string>"
},
"items": [
{
"quantity": 123,
"unit_price_cents": 123,
"weight_grams": 123,
"length_cm": 123,
"width_cm": 123,
"height_cm": 123
}
]
}
'const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-store-hash': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
destination: {country_code: 'DE', region: '<string>', postal_code: '<string>'},
items: [
{
quantity: 123,
unit_price_cents: 123,
weight_grams: 123,
length_cm: 123,
width_cm: 123,
height_cm: 123
}
]
})
};
fetch('https://app.papelship.com/api/v1/shipping/quote', 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/quote"
payload = {
"destination": {
"country_code": "DE",
"region": "<string>",
"postal_code": "<string>"
},
"items": [
{
"quantity": 123,
"unit_price_cents": 123,
"weight_grams": 123,
"length_cm": 123,
"width_cm": 123,
"height_cm": 123
}
]
}
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/quote",
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([
'destination' => [
'country_code' => 'DE',
'region' => '<string>',
'postal_code' => '<string>'
],
'items' => [
[
'quantity' => 123,
'unit_price_cents' => 123,
'weight_grams' => 123,
'length_cm' => 123,
'width_cm' => 123,
'height_cm' => 123
]
]
]),
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/quote"
payload := strings.NewReader("{\n \"destination\": {\n \"country_code\": \"DE\",\n \"region\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"items\": [\n {\n \"quantity\": 123,\n \"unit_price_cents\": 123,\n \"weight_grams\": 123,\n \"length_cm\": 123,\n \"width_cm\": 123,\n \"height_cm\": 123\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,
"currency": "<string>",
"zone": {
"id": 123,
"name": "<string>"
},
"rates": [
{
"rate_id": 123,
"zone_id": 123,
"name": "<string>",
"description": "<string>",
"carrier_code": "<string>",
"price_cents": 123,
"min_days": 123,
"max_days": 123,
"free": true
}
]
}{
"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.
Gövde
application/json