Comment on page
Rate Comparativa
Analisi preventiva costo spedizione
L'endpoint RateComparativa permette un analisi preventiva dei costi calcolabili a priori di una spedizione attraverso i Vostri listini (attivi o passivi) salvati e gestiti su Gsped, come ad esempio:
- Nolo (costo base della spedizione)
- Spese accessorie calcolabili a priori
- Costo contrassegno
- Costo assicurazione
- FUEL
- Zone disagiate o Isole
- Servizi accessori (al piano, al sabato etc)
- Addebiti per oversize su regole standard
- Etc.
Sono possibili due tipi di rating:
- ATTIVO: richiede solo analisi costi in base ai listini attivi, ovvero quelli che usate per rivendere la spedizione ai vostri clienti
- PASSIVO: analisi dei costi di spedizione in base ai listini sottoscritti con il corriere in fase di contrattazione. Questa modalità aggiunge in automatico anche il rating ATTIVO per permettere anche un'analisi rapida della differenza tra costi di acquisto e di vendita del trasporto.
get
https://api.gsped.it
/istanza/RateComparativa
RateComparativa
A seguire dei piccoli snippet di esempio in diversi linguaggi:
PHP
GO
PYTHON
C#
JAVA
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.gsped.it/sandbox/RateComparativa?colli=1&contrassegno=&documenti=&peso=104&preavviso_telefonico=&rcpt_addr=via%20felrina%20sud%20172&rcpt_cap=31044&rcpt_city=Montebelluna&rcpt_country_code=IT&rcpt_prov=BG&sender_addr=VIA%20FERRANTE%20CARACCIOLO&sender_cap=24040&sender_city=LECCE&sender_country_code=IT&sender_prov=BG&tipo_listino=passivo&valore=&volume=0&invoiced_client_id=1249",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Accept: */*",
"Cache-Control: no-cache",
"Connection: keep-alive",
"Host: apigsped.it",
"accept-encoding: gzip, deflate",
"cache-control: no-cache",
"x-api-key: YOUR_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"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.gsped.it/sandbox/RateComparativa?colli=1&contrassegno=&documenti=&peso=104&preavviso_telefonico=&rcpt_addr=via%20felrina%20sud%20172&rcpt_cap=31044&rcpt_city=Montebelluna&rcpt_country_code=IT&rcpt_prov=BG&sender_addr=VIA%20FERRANTE%20CARACCIOLO&sender_cap=24040&sender_city=LECCE&sender_country_code=IT&sender_prov=BG&tipo_listino=passivo&valore=&volume=0&invoiced_client_id=1249"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "YOUR_API_KEY")
req.Header.Add("Accept", "*/*")
req.Header.Add("Cache-Control", "no-cache")
req.Header.Add("Host", "api.gsped.it")
req.Header.Add("accept-encoding", "gzip, deflate")
req.Header.Add("Connection", "keep-alive")
req.Header.Add("cache-control", "no-cache")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://api.gsped.it/sandbox/RateComparativa"
querystring = {"colli":"1","contrassegno":"","documenti":"","peso":"104","preavviso_telefonico":"","rcpt_addr":"via%20felrina%20sud%20172","rcpt_cap":"31044","rcpt_city":"Montebelluna","rcpt_country_code":"IT","rcpt_prov":"BG","sender_addr":"VIA%20FERRANTE%20CARACCIOLO","sender_cap":"24040","sender_city":"LECCE","sender_country_code":"IT","sender_prov":"BG","tipo_listino":"passivo","valore":"","volume":"0","invoiced_client_id":"1249"}
headers = {
'x-api-key': "YOUR_API_KEY",
'Accept': "*/*",
'Cache-Control': "no-cache",
'Host': "api.gsped.it",
'accept-encoding': "gzip, deflate",
'Connection': "keep-alive",
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
var client = new RestClient("https://api.aws.gsped.it/sandbox/RateComparativa?colli=1&contrassegno=&documenti=&peso=104&preavviso_telefonico=&rcpt_addr=via%20felrina%20sud%20172&rcpt_cap=31044&rcpt_city=Montebelluna&rcpt_country_code=IT&rcpt_prov=BG&sender_addr=VIA%20FERRANTE%20CARACCIOLO&sender_cap=24040&sender_city=LECCE&sender_country_code=IT&sender_prov=BG&tipo_listino=passivo&valore=&volume=0&invoiced_client_id=1249");
var request = new RestRequest(Method.GET);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Connection", "keep-alive");
request.AddHeader("accept-encoding", "gzip, deflate");
request.AddHeader("Host", "api.gsped.it");
request.AddHeader("Cache-Control", "no-cache");
request.AddHeader("Accept", "*/*");
request.AddHeader("x-api-key", "YOUR_API_KEY");
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("http://api.gsped.it/sandbox/RateComparativa?client_id=0000002&colli=1&contrassegno=&documenti=&peso=104&preavviso_telefonico=&rcpt_addr=via%20felrina%20sud%20172&rcpt_cap=31044&rcpt_city=Montebelluna&rcpt_country_code=IT&rcpt_prov=BG&sender_addr=VIA%20FERRANTE%20CARACCIOLO&sender_cap=24040&sender_city=LECCE&sender_country_code=IT&sender_prov=BG&tipo_listino=passivo&valore=&volume=0&invoiced_client_id=1249")
.get()
.addHeader("x-api-key", "YOUR_API_KEY")
.addHeader("Accept", "*/*")
.addHeader("Cache-Control", "no-cache")
.addHeader("Host", "apistaging.aws.gsped.it")
.addHeader("accept-encoding", "gzip, deflate")
.addHeader("Connection", "keep-alive")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Last modified 2yr ago