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 By Ddt Num

Just as shipmentConfirm, this enpoint confirms the shipments without using its ID (a Gsped internal reference) but, instead, using the numeric reference given at the time of shipping.

IMPORTANTE - PLEASE NOTE : ****The numeric reference must be unique (there must not ne a shipment with the same reference)

Confirm the shipment using the numeric reference

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

Headers

Name
Type
Description

Content-Type*

String

application/json

x-api-key*

String

Api Key fornita da Gsped - Apikey given by Gsped

ddt_num

Array Integet

Numeric references of the shipments to confirm

{
    "status": "1 spedizioni confermate, 0 errori",
    "errors": []
}
{
    "error": "ddt_num non indicati o indicati in formato errato"
}
{
    "status": false,
    "error": "Invalid API key "
}

** Example Snippets:**

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.gsped.it/sandbox/ShipmentConfirmByDdtnum',
  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 =>'{
  "ddt_num": [
      "123",
      "124"
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'x-api-key: YOUR-API-KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import http.client
import json

conn = http.client.HTTPSConnection("api.gsped.it")
payload = json.dumps({
  "ddt_num": [
    "123",
    "124"
  ]
})
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'YOUR-API-KEY'
}
conn.request("POST", "/sandbox/ShipmentConfirmByDdtnum", 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/ShipmentConfirmByDdtnum"
  method := "POST"

  payload := strings.NewReader(`{
  "ddt_num": [
      "123",
      "124"
  ]
}`)

  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 RestClient("https://api.gsped.it/sandbox/ShipmentConfirmByDdtnum");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("x-api-key", "YOUR-API-KEY");
var body = @"{" + "\n" +
@"  ""ddt_num"": [" + "\n" +
@"      ""123""," + "\n" +
@"      ""124""" + "\n" +
@"  ]" + "\n" +
@"}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
curl --location --request POST 'https://api.gsped.it/sandbox/ShipmentConfirmByDdtnum' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR-API-KEY' \
--data-raw '{
  "ddt_num": [
      "123",
      "124"
  ]
}'
PreviousShipment ConfirmNextPickup (pickup request)

Last updated 2 years ago