LogoLogo
English
English
  • OVERVIEW
    • Labels in 5 minutes
    • Introduction
    • Authentication
    • Requests and responses form
    • Couriers and services
    • PLT-licensed couriers (paperless)
    • Gsped codes
    • Throttling
    • Non-standard payload
  • Spedizioni e Dintorni
    • Shipment
    • ShipmentsList
    • Shipment by DDT Alpha
    • Shipment By DDT Num
    • Shipment Confirm
    • Shipment Confirm By Ddt Num
    • Pickup (pickup request)
    • POD (proof of delivery)
    • Reprint
    • Reprint By Reference
    • Tracking
    • PUP Managing (pick-up points)
    • Upload Documents
    • Add Parcel
    • CloseDoc
  • Gestione Ordini
    • Orders
    • Order To Shipment
  • Rating
    • Comparative Rate
Powered by GitBook
On this page
  1. Spedizioni e Dintorni

Shipment Confirm

Shipment confirm operation

This operation confirms that the generated shipments have correctly managed and are going to be given to the courier/s

On the Gsped interface the confirmed shipments are transferred from the section Outgoing shipments to the section Expedition started

The confirm operation could be performed in two ways :

Using the labeling data ( client_id ). In this case all the shipments of the client_id will be confirmed. Using the shipping list ( ID spedizioni ). In this case the single shipments will be confirmed.

PLEASE NOTE : ****In the confirm operation the HTTP 200 code is returned - even if the shipments are not actually confirmed - in the following situations:

  • If you attempt to confirm shipments that have already been confirmed

  • If you attempt to confirm with the status error and/or shipments that are still in progress.

Pay attention to the message returned in the field status; here there will be indicated how many shipments have been confirmed and how many not. Example: "10 shipments confirmed, 2 errors occurred"

In case there are shipments we are not able to confirm, in the array errors there will be indicated which shipments have not been confirmed.

Please note: During this operation it is possible to request the creation of the shipping manifest to show the courier at the withdrawal of the goods.

Shipment confirm and creation of the shipping manifest (additional)

POST https://api.gsped.it/[INSTANCE]/shipmentConfirm

Headers

Name
Type
Description

Content-Type*

String

application/json

x-api-key*

String

Api Key given by Gsped

Request Body

Name
Type
Description

client_id*

Integer

Value communicated by Gsped (in alternative to the ID parameter)

id*

Array

List of the numeric IDs of the shipments to confirm (in alternative to the client ID)

create_manifest

String

Accepted values Y or N

\

If Y, in the response the field manifest with the PDF of the shipping manifest will be included.

{
  "status": "25 spedizioni confermate, 0 errori",
  "errors": [],
  "manifest": "JVBERi0xLjMKM......UVPRgo=",
  "manifest_id": 10006
}
{
    "error": "ID spedizione non indicata"
}
{
    "status": false,
    "error": "Invalid API key "
}

Example Snippets :

<?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"
  ]
}'

PreviousShipment By DDT NumNextShipment Confirm By Ddt Num

Last updated 7 months ago