Preventivo spedizione
curl --request POST \
--url https://service.e-manager.io/api/v1/integrations/shipments/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"orderId": 12345,
"warehouseId": 10,
"destinationZip": "20121",
"destinationCountryCode": "IT",
"totalWeight": 2.5,
"totalVolume": 12000,
"parcels": [
{
"weight": 1.2,
"length": 30,
"depth": 20,
"height": 10
}
]
}
'import requests
url = "https://service.e-manager.io/api/v1/integrations/shipments/quote"
payload = {
"orderId": 12345,
"warehouseId": 10,
"destinationZip": "20121",
"destinationCountryCode": "IT",
"totalWeight": 2.5,
"totalVolume": 12000,
"parcels": [
{
"weight": 1.2,
"length": 30,
"depth": 20,
"height": 10
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderId: 12345,
warehouseId: 10,
destinationZip: '20121',
destinationCountryCode: 'IT',
totalWeight: 2.5,
totalVolume: 12000,
parcels: [{weight: 1.2, length: 30, depth: 20, height: 10}]
})
};
fetch('https://service.e-manager.io/api/v1/integrations/shipments/quote', 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://service.e-manager.io/api/v1/integrations/shipments/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([
'orderId' => 12345,
'warehouseId' => 10,
'destinationZip' => '20121',
'destinationCountryCode' => 'IT',
'totalWeight' => 2.5,
'totalVolume' => 12000,
'parcels' => [
[
'weight' => 1.2,
'length' => 30,
'depth' => 20,
'height' => 10
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://service.e-manager.io/api/v1/integrations/shipments/quote"
payload := strings.NewReader("{\n \"orderId\": 12345,\n \"warehouseId\": 10,\n \"destinationZip\": \"20121\",\n \"destinationCountryCode\": \"IT\",\n \"totalWeight\": 2.5,\n \"totalVolume\": 12000,\n \"parcels\": [\n {\n \"weight\": 1.2,\n \"length\": 30,\n \"depth\": 20,\n \"height\": 10\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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))
}HttpResponse<String> response = Unirest.post("https://service.e-manager.io/api/v1/integrations/shipments/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": 12345,\n \"warehouseId\": 10,\n \"destinationZip\": \"20121\",\n \"destinationCountryCode\": \"IT\",\n \"totalWeight\": 2.5,\n \"totalVolume\": 12000,\n \"parcels\": [\n {\n \"weight\": 1.2,\n \"length\": 30,\n \"depth\": 20,\n \"height\": 10\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service.e-manager.io/api/v1/integrations/shipments/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": 12345,\n \"warehouseId\": 10,\n \"destinationZip\": \"20121\",\n \"destinationCountryCode\": \"IT\",\n \"totalWeight\": 2.5,\n \"totalVolume\": 12000,\n \"parcels\": [\n {\n \"weight\": 1.2,\n \"length\": 30,\n \"depth\": 20,\n \"height\": 10\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"carrierCompanyId": 6,
"carrierName": "BRT",
"carrierCode": "BRT",
"basePrice": "19.50",
"zoneLabel": "76 - 100",
"zoneName": "ITALIA",
"coefficient": "5000",
"chargeableWeight": "112.10",
"realWeight": "112.1",
"volumetricWeight": "112.10",
"contractLabel": "CARINARO",
"surchargePrice": "0",
"extraSteps": 1,
"extraPrice": "4.87",
"carrierOptionsTotal": "1.46",
"carrierOptionsDetail": [
{
"price": "6%",
"calculated": 1.46,
"description": "SUPPLEMENTO CARBURANTE %"
}
],
"totalPrice": "25.83",
"vatAmount": "5.68",
"totalPriceWithVat": "31.51",
"codPrice": "0",
"insurancePrice": "0",
"maxWeight": "100.99",
"maxWeightCarrierCompany": null
}
]Preventivo spedizione
Calcola i preventivi di spedizione per tutti i corrieri disponibili. Modalità A: solo orderId. Modalità B: warehouseId, destinazione, peso/volume o colli. In caso di successo restituisce un array ordinato per totalPriceWithVat. Se nessun corriere è applicabile, HTTP 200 restituisce un oggetto warning (non un array): vedi risposta warning e codici warning. Richiede scope shipments:quote.
POST
/
v1
/
integrations
/
shipments
/
quote
Preventivo spedizione
curl --request POST \
--url https://service.e-manager.io/api/v1/integrations/shipments/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"orderId": 12345,
"warehouseId": 10,
"destinationZip": "20121",
"destinationCountryCode": "IT",
"totalWeight": 2.5,
"totalVolume": 12000,
"parcels": [
{
"weight": 1.2,
"length": 30,
"depth": 20,
"height": 10
}
]
}
'import requests
url = "https://service.e-manager.io/api/v1/integrations/shipments/quote"
payload = {
"orderId": 12345,
"warehouseId": 10,
"destinationZip": "20121",
"destinationCountryCode": "IT",
"totalWeight": 2.5,
"totalVolume": 12000,
"parcels": [
{
"weight": 1.2,
"length": 30,
"depth": 20,
"height": 10
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderId: 12345,
warehouseId: 10,
destinationZip: '20121',
destinationCountryCode: 'IT',
totalWeight: 2.5,
totalVolume: 12000,
parcels: [{weight: 1.2, length: 30, depth: 20, height: 10}]
})
};
fetch('https://service.e-manager.io/api/v1/integrations/shipments/quote', 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://service.e-manager.io/api/v1/integrations/shipments/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([
'orderId' => 12345,
'warehouseId' => 10,
'destinationZip' => '20121',
'destinationCountryCode' => 'IT',
'totalWeight' => 2.5,
'totalVolume' => 12000,
'parcels' => [
[
'weight' => 1.2,
'length' => 30,
'depth' => 20,
'height' => 10
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://service.e-manager.io/api/v1/integrations/shipments/quote"
payload := strings.NewReader("{\n \"orderId\": 12345,\n \"warehouseId\": 10,\n \"destinationZip\": \"20121\",\n \"destinationCountryCode\": \"IT\",\n \"totalWeight\": 2.5,\n \"totalVolume\": 12000,\n \"parcels\": [\n {\n \"weight\": 1.2,\n \"length\": 30,\n \"depth\": 20,\n \"height\": 10\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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))
}HttpResponse<String> response = Unirest.post("https://service.e-manager.io/api/v1/integrations/shipments/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": 12345,\n \"warehouseId\": 10,\n \"destinationZip\": \"20121\",\n \"destinationCountryCode\": \"IT\",\n \"totalWeight\": 2.5,\n \"totalVolume\": 12000,\n \"parcels\": [\n {\n \"weight\": 1.2,\n \"length\": 30,\n \"depth\": 20,\n \"height\": 10\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service.e-manager.io/api/v1/integrations/shipments/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": 12345,\n \"warehouseId\": 10,\n \"destinationZip\": \"20121\",\n \"destinationCountryCode\": \"IT\",\n \"totalWeight\": 2.5,\n \"totalVolume\": 12000,\n \"parcels\": [\n {\n \"weight\": 1.2,\n \"length\": 30,\n \"depth\": 20,\n \"height\": 10\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"carrierCompanyId": 6,
"carrierName": "BRT",
"carrierCode": "BRT",
"basePrice": "19.50",
"zoneLabel": "76 - 100",
"zoneName": "ITALIA",
"coefficient": "5000",
"chargeableWeight": "112.10",
"realWeight": "112.1",
"volumetricWeight": "112.10",
"contractLabel": "CARINARO",
"surchargePrice": "0",
"extraSteps": 1,
"extraPrice": "4.87",
"carrierOptionsTotal": "1.46",
"carrierOptionsDetail": [
{
"price": "6%",
"calculated": 1.46,
"description": "SUPPLEMENTO CARBURANTE %"
}
],
"totalPrice": "25.83",
"vatAmount": "5.68",
"totalPriceWithVat": "31.51",
"codPrice": "0",
"insurancePrice": "0",
"maxWeight": "100.99",
"maxWeightCarrierCompany": null
}
]Body
application/json
Response
200 - application/json
Array di preventivi ordinati per totalPriceWithVat crescente. Se nessun corriere è disponibile, la risposta è un oggetto warning (stesso status 200): vedi risposta warning.
Was this page helpful?

