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.
Nota : In questa operazione è possibile richiedere che venga generato il borderò (manifest) da presentare al corriere all'atto del ritiro della merce.
Conferma delle spedizioni e generazione del borderò (opzionale)
POST https://api.gsped.it/[ISTANZA]/shipmentConfirm
Headers
Content-Type*
String
application/json
x-api-key*
String
Api Key fornita da Gsped
Request Body
client_id*
Integer
Valore comunicato da Gsped (In alternativa al parametro id)
id*
Array
Elenco di IDs numerici delle spedizioni da confermare (In alternativa a client_id)
create_manifest
String
Valori ammissibili Y o N. Se Y nella risposta verrà incluso il campo manifest che conterrà il PDF del manifest delle spedizioni confermate.
{
"status": "25 spedizioni confermate, 0 errori",
"errors": [],
"manifest": "JVBERi0xLjMKM......UVPRgo=",
"manifest_id": 10006
}{
"error": "ID spedizione non indicata"
}{
"status": false,
"error": "Invalid API key "
}Snippets codice di esempio :
<?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;phpimport 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"
]
}'Last updated
Was this helpful?
