API Documentation
Italiano
Search
K
Comment on page

Shipment Confirm

Operazione di conferma spedizioni
Con questa operazione si conferma che le spedizioni generate sono corrette e sono in processo di affido al corriere / corrieri.
Sull'interfaccia di Gsped le spedizioni confermate vengono spostate dalla sezione Spedizioni in partenza alla sezione Spedizioni partite.
L'operazione di conferma può essere eseguita in due modalità :
  • Indicando l'anagrafica di bollettazione ( client_id ) : In questo caso verranno confermate tutte le spedizioni del client_id indicato.
  • Indicando l'elenco di spedizioni ( ID spedizioni ) : In questo caso verranno confermate le singole spedizioni specificate.
ATTENZIONE : Nell'operazione di conferma vi viene restituito codice HTTP 200 anche quando le spedizioni non vengono effettivamente confermate nei seguenti casi :
  • Si tenta di confermare spedizioni già confermate
  • Si tenta di confermare spedizioni in errore e/o ancora in fase di elaborazione
Fare attenzione al messaggio restituito nel campo status, in quanto qui verranno indicate quante spedizioni sono state confermate e quante no, Esempio : "10 spedizioni confermate, 2 errori"
Nel caso vi siano spedizioni che non siamo stato in grado di confermare, nel array errors verranno indicate le spedizioni che non sono state conferma.
Nota : In questa operazione è possibile richiedere che venga generato il borderò (manifest) da presentare al corriere all'atto del ritiro della merce.
post
https://api.gsped.it
/[ISTANZA]/shipmentConfirm
Conferma delle spedizioni e generazione del borderò (opzionale)

Snippets codice di esempio :

PHP
Python
GO
C#
cURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.gsped.it/sandbox/shipmentConfirm',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"create_manifest" : "Y",
"id": [
"12345",
"12346",
"12347"
]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'x-api-key: YOUR-API-KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;php
import http.client
import json
conn = http.client.HTTPSConnection("api.gsped.it")
payload = json.dumps({
"create_manifest": "Y",
"id": [
"12345",
"12346",
"12347"
]
})
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR-API-KEY'
}
conn.request("POST", "/sandbox/shipmentConfirm", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.gsped.it/sandbox/shipmentConfirm"
method := "POST"
payload := strings.NewReader(`{
"create_manifest" : "Y",
"id": [
"12345",
"12346",
"12347"
]
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("x-api-key", "YOUR-API-KEY")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.gsped.it/sandbox/shipmentConfirm"),
Headers =
{
{ "x-api-key", "YOUR-API-KEY" },
},
Content = new StringContent("{\n \"create_manifest\" : \"Y\",\n \"id\": [\n \"12345\",\n \"12346\",\n \"12347\"\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
curl --location --request POST 'https://api.gsped.it/sandbox/shipmentConfirm' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR-API-KEY' \
--data-raw '{
"create_manifest" : "Y",
"id": [
"12345",
"12346",
"12347"
]
}'